Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Files /
Chapter 1 - Introduction to File Management / File Management Reference
Data Structures


Standard File Reply Records

The procedures StandardGetFile and StandardPutFile both return information
to your application using a standard file reply record, which is defined by the StandardFileReply data type. The reply record identifies selected files with a file system specification record, which you can pass directly to many of the File Manager functions described in the sections that follow. The reply record also contains fields that support several Finder features.

TYPE StandardFileReply =
RECORD
   sfGood:        Boolean;    {TRUE if user did not cancel}
   sfReplacing:   Boolean;    {TRUE if replacing file with same name}
   sfType:        OSType;     {file type}
   sfFile:        FSSpec;     {selected file, folder, or volume}
   sfScript:      ScriptCode; {script of file, folder, or volume name}
   sfFlags:       Integer;    {Finder flags of selected item}
   sfIsFolder:    Boolean;    {selected item is a folder}
   sfIsVolume:    Boolean;    {selected item is a volume}
   sfReserved1:   LongInt;    {reserved}
   sfReserved2:   Integer;    {reserved}
END;
Field Description
sfGood
Reports whether the reply record is valid. The value is TRUE after the user clicks Save or Open; FALSE after the user clicks Cancel. When the user has completed the dialog box, the other fields in the reply record are valid only if the sfGood field contains TRUE.
sfReplacing
Reports whether a file to be saved replaces an existing file of
the same name. This field is valid only after a call to the StandardPutFile or CustomPutFile procedure. When
the user assigns a name that duplicates that of an existing file,
the Standard File Package asks for verification by displaying a subsidiary dialog box (illustrated in Figure 1-10). If the user
verifies the name, the Standard File Package sets the sfReplacing field to TRUE and returns to your application; if the user cancels
the overwriting of the file, the Standard File Package returns
to the main dialog box. If the name does not conflict with an existing name, the Standard File Package sets the field to FALSE and returns.
sfType
Contains the file type of the selected file. (File types are described in the chapter "Finder Interface" in Inside Macintosh: Macintosh Toolbox Essentials.) Only StandardGetFile and CustomGetFile return a file type in this field.
sfFile
Describes the selected file, folder, or volume with a file system specification record, which contains a volume reference number, parent directory ID, and name. (See the chapter "File Manager" in this book for a complete description of the file system specification record.) If the selected item is an alias for another item, the Standard File Package resolves the alias and places the file system specification record for the target in the sfFile field when the user completes the dialog box. If the selected file is a stationery pad, the reply record describes the file itself, not a copy of the file.
sfScript
Identifies the script in which the name of the document is to be displayed. (This information is used by the Finder and by the Standard File Package.) A script code of smSystemScript (-1) represents the default system script.
sfFlags
Contains the Finder flags from the Finder information record in the catalog entry for the selected file. (See the chapter "Finder Interface" in Inside Macintosh: Macintosh Toolbox Essentials for a description of the Finder flags.) This field is returned only by StandardGetFile and CustomGetFile. If your application supports stationery, it should check the stationery bit in the Finder flags to determine whether to treat the selected file as stationery. Unlike the Finder, the Standard File Package does not automatically create a document from a stationery pad and pass your application the new document. If the user opens a stationery document from within an application that does not support stationery, the Standard File Package displays a dialog box warning the user that the master copy is being opened.
sfIsFolder
Reports whether the selected item is a folder (TRUE) or a file or volume (FALSE). This field is meaningful only during the execution of a dialog hook function.
sfIsVolume
Reports whether the selected item is a volume (TRUE) or a file or folder (FALSE). This field is meaningful only during the execution of a dialog hook function.
sfReserved1
Reserved.
sfReserved2
Reserved.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996