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 2 - File Manager / File Manager Reference
File System Specification Routines / Creating and Deleting Files and Directories


FSpDirCreate

You can use the FSpDirCreate function to create a new directory.

FUNCTION FSpDirCreate (spec: FSSpec; scriptTag: ScriptCode; 
                        VAR createdDirID: LongInt): OSErr;
spec
An FSSpec record specifying the directory to be created.
scriptTag
The code of the script system in which the directory name is to be displayed. If you have established the name and location of the new directory using either the StandardPutFile or CustomPutFile procedure, specify the script code returned in the reply record. (See the chapter "Standard File Package" in this book for a description of StandardPutFile and CustomPutFile.) Otherwise, specify the system script by setting the scriptTag parameter to the value smSystemScript.
createdDirID
The directory ID of the directory that was created.
DESCRIPTION
The FSpDirCreate function creates a new directory and returns the directory ID of the new directory in the createdDirID parameter. Then FSpDirCreate sets the date and time of creation and last modification to the current date and time.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for FSpDirCreate are
Trap macroSelector
_HighLevelHFSDispatch$0005

RESULT CODES
noErr0No error
dirFulErr-33File directory full
dskFulErr-34Disk is full
nsvErr-35No such volume
ioErr-36I/O error
bdNamErr-37Bad filename
fnfErr-43Directory not found or incomplete pathname
wPrErr-44Hardware volume lock
vLckdErr-46Software volume lock
dupFNErr-48Duplicate filename and version
dirNFErr-120Directory not found or incomplete pathname
wrgVolTypErr-123Not an HFS volume
afpAccessDenied-5000User does not have the correct access

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996