macos_resources.py

Python access to MacOS Resource files.

Download

View macos_resources.py

Description

Python read-only access to old MacOS Resources on Linux, MOSX, or other platforms, including AppleSingle/AppleDouble files, /rsrc on MOSX, and __MACOSX/ directory trees in ditto archives. Writing resource files or AppleSingle/AppleDouble files is not implemented, as I see little need for it, compared even to the need to read such old files.

When run as a script and given a pathname, finds the resources from that pathname, exctracting them from AppleSingle/AppleDouble and displaying that, and lists the resources found. When run with the option --ditto and a pathname(s), prints the pathnames in the order needed for archives readable by Apple's rather shoddy ditto program, recursing into directories (there is also an option to read the pathnames from a file, so they don't have to be easy to shell-escape).

When used as a Python module:

  • get_applesingle_data() loads AppleSingle/AppleDouble files into memory, with or without Data or Resource data.
  • load_resources() loads Resource files from data files, from AppleSingle/AppleDouble data, and, on MOSX, from /rsrc files.
  • Find_resources() finds the resources from a base path.
  • ditto_order() prints a list of the files and Resource files in the order needed by the Next-Apple's rather shoddy ditto program when expanding a .zip file.

Run pydoc on it for more information.

 

Back to Tony NelsonJHC's R Pentomino's Home Page

Valid HTML 4.0!