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