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
High-Level HFS Routines / Creating and Deleting Files and Directories


DirCreate

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

FUNCTION DirCreate (vRefNum: Integer; parentDirID: LongInt; 
                     directoryName: Str255; 
                     VAR createdDirID: LongInt): OSErr;
vRefNum
A volume reference number, a working directory reference number, or 0 for the default volume.
parentDirID
The directory ID of the parent directory; if it's 0, the new directory
is placed in the root directory of the specified volume.
directoryName
The name of the new directory.
createdDirID
The directory ID of the created directory.
DESCRIPTION
The DirCreate function creates a new directory and returns the directory ID of the new directory in the createdDirID parameter. The date and time of its creation and last modification are set to the current date and time.

Note
A directory ID, unlike a volume reference number or a working directory reference number, is a LongInt value.
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