zipfile module and directories and symlinks

Jim jhefferon at smcvt.edu
Thu Apr 21 13:07:56 EDT 2005


I'm using the zipfile module to unpack bundles.  Is there a Right way
to recognize directories, or do I just check if the name ends in '/'
(i.e., os.sep)?  That is, I have this.

  for bundleInfo in bundleObject.infolist():
     ...stuff...
     if bundleInfo.filename[-1:]==os.sep:
         make a dir
     else
         make a file

Is that right?  What about symlinks?  How do I know one of those?

Thanks for any help,
Jim




More information about the Python-list mailing list