ASPN ActiveState Programmer Network
  ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups | Web Services
SEARCH

Reference
ActivePython 2.5
Python Documentation
Macintosh Module Reference
2. MacPython Modules
2.1 macpath -- MacOS path manipulation functions
2.2 macfs -- Various file system services
2.3 ic -- Access to Internet Config
2.4 MacOS -- Access to Mac OS interpreter features
2.5 macostools -- Convenience routines for file manipulation
2.6 findertools -- The finder's Apple Events interface
2.7 EasyDialogs -- Basic Macintosh dialogs
2.8 FrameWork -- Interactive application framework
2.9 autoGIL -- Global Interpreter Lock handling in event loops

MyASPN >> Reference >> ActivePython 2.5 >> Python Documentation >> Macintosh Module Reference >> 2. MacPython Modules
ActivePython 2.5 documentation

2.5 macostools -- Convenience routines for file manipulation

Availability: Macintosh.

This module contains some convenience routines for file-manipulation on the Macintosh. All file parameters can be specified as pathnames, FSRef or FSSpec objects. This module expects a filesystem which supports forked files, so it should not be used on UFS partitions.

The macostools module defines the following functions:

copy( src, dst[, createpath[, copytimes]])
Copy file src to dst. If createpath is non-zero the folders leading to dst are created if necessary. The method copies data and resource fork and some finder information (creator, type, flags) and optionally the creation, modification and backup times (default is to copy them). Custom icons, comments and icon position are not copied.

copytree( src, dst)
Recursively copy a file tree from src to dst, creating folders as needed. src and dst should be specified as pathnames.

mkalias( src, dst)
Create a finder alias dst pointing to src.

touched( dst)
Tell the finder that some bits of finder-information such as creator or type for file dst has changed. The file can be specified by pathname or fsspec. This call should tell the finder to redraw the files icon.

BUFSIZ
The buffer size for copy, default 1 megabyte.

Note that the process of creating finder aliases is not specified in the Apple documentation. Hence, aliases created with mkalias() could conceivably have incompatible behaviour in some cases.

See About this document... for information on suggesting changes.

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState 2004 All rights reserved