PBDirCreate
You can use the PBDirCreate function to create a new directory.
FUNCTION PBDirCreate (paramBlock: HParmBlkPtr; async: Boolean):
OSErr;
paramBlock
- A pointer to a basic HFS parameter block.
async
- A Boolean value that specifies asynchronous (
TRUE) or synchronous (FALSE) execution.
| --> | ioCompletion | ProcPtr | A pointer to a completion routine. |
| <-- | ioResult | OSErr | The result code of the function. |
| <-> | ioNamePtr | StringPtr | A pointer to a pathname. |
| --> | ioVRefNum | Integer | A volume specification. |
| <-> | ioDirID | LongInt | A directory ID. |
DESCRIPTION
The PBDirCreate function is identical to PBHCreate except that it creates a new directory instead of a file. You can specify the parent of the directory to be created in ioDirID; if it's 0, the new directory is placed in the root directory of the specified volume. The directory ID of the new directory is returned in ioDirID. 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.
ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for PBDirCreate are
| Trap macro | Selector |
| _HFSDispatch | $0006 |
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 |