0

I'm trying to distinguish between folder and package on a mac using a python code.

os.path.isfile('package') returns false and os.walk('package') walks trough the package as if it where any ordinary folder.

Thanks for thinking along:)

DCB
  • 107
  • 12
  • You mean [OS X packages](https://en.wikipedia.org/wiki/Package_(OS_X)), not Python packages, right? OS X packages are *just folders* with a special package extension in the name. – Martijn Pieters Sep 03 '15 at 17:13
  • What makes a directory a package is configured in the OS somewhere. – Martijn Pieters Sep 03 '15 at 17:13
  • I indeed meant a OS X package. The objects "info window" shows a difference between a folder and a package (Xcode project or an app or whatever..). – DCB Sep 03 '15 at 17:18
  • I'm using python 2.7 – DCB Sep 03 '15 at 19:23
  • I just installed the xattr library. However, when I run the xattr.getxattr() function on a file like: xattr.getxattr("fileToBeScanned", u'com.apple.FinderInfo'). I get either nothing for a .DS_Store file, or lots of errors for all other objects (files, folders, packages): IOError: [Errno 93] Attribute not found: – DCB Sep 03 '15 at 20:27

0 Answers0