Important: The information in this document is obsolete and should not be used for new development.
PBCatMove
You can use thePBCatMovefunction to move files or directories from one directory to another on the same volume.
FUNCTION PBCatMove (paramBlock: CMovePBPtr; async: Boolean): OSErr;
paramBlock- A pointer to a catalog move parameter block.
async- A Boolean value that specifies asynchronous (
TRUE) or synchronous (FALSE) execution.
--> ioCompletionProcPtrA pointer to a completion routine. <-- ioResultOSErrThe result code of the function. --> ioNamePtrStringPtrA pointer to the name of the file or directory to be moved. --> ioVRefNumIntegerA volume specification. --> ioNewNameStringPtrA pointer to the name of the directory into which the file or directory is to
be moved.--> ioNewDirIDLongIntThe directory ID of the directory into which the file or directory is to be moved, if ioNewNameisNIL. IfioNewNameis notNIL, this is the parent directory ID of the directory into which the file or directory is to be moved.--> ioDirIDLongIntThe directory ID of the file or directory to be moved. DESCRIPTION
ThePBCatMovefunction moves a file or directory from one directory to another within a volume.PBCatMoveis strictly a file catalog operation; it does not actually change the location of the file or directory on the disk.The source file or directory should be specified by its volume, parent directory ID, and partial pathname. Pass a volume specification in
ioVRefNum. Pass the parent directory ID in theioDirIDfield and a pointer to the partial pathname in theioNamePtrfield.The name of the directory into which the file or directory is to be moved is specified by the
ioNewNamefield. If a valid directory name is provided forioNewName, the destination directory's parent directory is specified inioNewDirID. However, you can specifyNILforioNewName, in which caseioNewDirIDshould be set to the directory ID of the destination directory itself.
The
- Note
- It is usually simplest to specify the destination directory by passing
its directory ID in theioNewDirIDfield and by settingioNewName
toNIL.![]()
PBCatMovefunction cannot move a file or directory to another volume (that is,ioVRefNumis used in specifying both the source and the destination). Also, you cannot use it to rename files or directories; to rename a file or directory, usePBHRename.If a file ID reference exists for the file, the file ID reference remains with the moved file.
ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector forPBCatMoveare
Trap macro Selector _HFSDispatch $0005 RESULT CODES