This module provides access to Macintosh FSSpec handling, the Alias
Manager, finder aliases and the Standard File package.
Whenever a function or method expects a file argument, this
argument can be one of three things: (1) a full or partial Macintosh
pathname, (2) an FSSpec object or (3) a 3-tuple
(wdRefNum, parID, name) as described in
Inside Macintosh: Files. A description of aliases and the
Standard File package can also be found there.
A module, macfsn, is auto-imported to replace
StandardFile calls in macfs with NavServices calls.
Resolve an alias file. Returns a 3-tuple (fsspec,
isfolder, aliased) where fsspec is the resulting
FSSpec object, isfolder is true if fsspec points
to a folder and aliased is true if the file was an alias in the
first place (otherwise the FSSpec object for the file itself
Present the user with a standard ``open input file''
dialog. Optionally, you can pass up to four 4-character file types to limit
the files the user can choose from. The function returns an FSSpec
object and a flag indicating that the user completed the dialog
Present the user with a standard ``open output file''
dialog. prompt is the prompt string, and the optional
default argument initializes the output file name. The function
returns an FSSpec object and a flag indicating that the user
completed the dialog without cancelling.
Present the user with a non-standard ``select a directory'' dialog. You
have to first open the directory before clicking on the ``select current
directory'' button. prompt is the prompt string which will be
displayed at the top of the dialog. Return an FSSpec object and
Set the folder that is initially presented to the user when one of
the file selection dialogs is presented. fsspec should point to
a file in the folder, not the folder itself (the file need not exist,
though). If no argument is passed the folder will be set to the
current directory, i.e. what os.getcwd() returns.
Note that starting with system 7.5 the user can change Standard File
behaviour with the ``general controls'' control panel, thereby making
this call inoperative.
Locates one of the ``special'' folders that MacOS knows about, such as
the trash or the Preferences folder. where is the disk to
search, which is the 4-character string specifying which folder to
locate. Setting create causes the folder to be created if it
does not exist. Returns a (vrefnum, dirid) tuple.