cinap_lenrekadd hg and python4bb9e2215 years agoHistory
105 lines · 3.6 KB · TeX
RawDownload
\section{\module{macostools} ---         Convenience routines for file manipulation} \declaremodule{standard}{macostools}  \platform{Mac}\modulesynopsis{Convenience routines for file manipulation.}  This module contains some convenience routines for file-manipulationon the Macintosh. All file parameters can be specified aspathnames, \class{FSRef} or \class{FSSpec} objects.  This moduleexpects a filesystem which supports forked files, so it should notbe used on UFS partitions. The \module{macostools} module defines the following functions:  \begin{funcdesc}{copy}{src, dst\optional{, createpath\optional{, copytimes}}}Copy file \var{src} to \var{dst}.  If \var{createpath} is non-zerothe folders leading to \var{dst} are created if necessary.The method copies data andresource fork and some finder information (creator, type, flags) andoptionally the creation, modification and backup times (default is tocopy them). Custom icons, comments and icon position are not copied.\end{funcdesc} \begin{funcdesc}{copytree}{src, dst}Recursively copy a file tree from \var{src} to \var{dst}, creatingfolders as needed. \var{src} and \var{dst} should be specified aspathnames.\end{funcdesc} \begin{funcdesc}{mkalias}{src, dst}Create a finder alias \var{dst} pointing to \var{src}.\end{funcdesc} \begin{funcdesc}{touched}{dst}Tell the finder that some bits of finder-information such as creatoror type for file \var{dst} has changed. The file can be specified bypathname or fsspec. This call should tell the finder to redraw thefiles icon.\end{funcdesc} \begin{datadesc}{BUFSIZ}The buffer size for \code{copy}, default 1 megabyte.\end{datadesc} Note that the process of creating finder aliases is not specified inthe Apple documentation. Hence, aliases created with \function{mkalias()}could conceivably have incompatible behaviour in some cases.  \section{\module{findertools} ---         The \program{finder}'s Apple Events interface} \declaremodule{standard}{findertools}  \platform{Mac}\modulesynopsis{Wrappers around the \program{finder}'s Apple Events interface.}  This module contains routines that give Python programs access to somefunctionality provided by the finder. They are implemented as wrappersaround the AppleEvent\index{AppleEvents} interface to the finder. All file and folder parameters can be specified either as fullpathnames, or as \class{FSRef} or \class{FSSpec} objects. The \module{findertools} module defines the following functions:  \begin{funcdesc}{launch}{file}Tell the finder to launch \var{file}. What launching means depends on the file:applications are started, folders are opened and documents are openedin the correct application.\end{funcdesc} \begin{funcdesc}{Print}{file}Tell the finder to print a file. The behaviour is identical to selecting the file and usingthe print command in the finder's file menu.\end{funcdesc} \begin{funcdesc}{copy}{file, destdir}Tell the finder to copy a file or folder \var{file} to folder\var{destdir}. The function returns an \class{Alias} object pointing tothe new file.\end{funcdesc} \begin{funcdesc}{move}{file, destdir}Tell the finder to move a file or folder \var{file} to folder\var{destdir}. The function returns an \class{Alias} object pointing tothe new file.\end{funcdesc} \begin{funcdesc}{sleep}{}Tell the finder to put the Macintosh to sleep, if your machinesupports it.\end{funcdesc} \begin{funcdesc}{restart}{}Tell the finder to perform an orderly restart of the machine.\end{funcdesc} \begin{funcdesc}{shutdown}{}Tell the finder to perform an orderly shutdown of the machine.\end{funcdesc}