Important: The information in this document is obsolete and should not be used for new development.
PBCatMove
You can use thePBCatMove
function 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.
--> ioCompletion
ProcPtr
A pointer to a completion routine. <-- ioResult
OSErr
The result code of the function. --> ioNamePtr
StringPtr
A pointer to the name of the file or directory to be moved. --> ioVRefNum
Integer
A volume specification. --> ioNewName
StringPtr
A pointer to the name of the directory into which the file or directory is to
be moved.--> ioNewDirID
LongInt
The directory ID of the directory into which the file or directory is to be moved, if ioNewName
isNIL
. IfioNewName
is notNIL
, this is the parent directory ID of the directory into which the file or directory is to be moved.--> ioDirID
LongInt
The directory ID of the file or directory to be moved. DESCRIPTION
ThePBCatMove
function moves a file or directory from one directory to another within a volume.PBCatMove
is 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 theioDirID
field and a pointer to the partial pathname in theioNamePtr
field.The name of the directory into which the file or directory is to be moved is specified by the
ioNewName
field. If a valid directory name is provided forioNewName
, the destination directory's parent directory is specified inioNewDirID
. However, you can specifyNIL
forioNewName
, in which caseioNewDirID
should 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 theioNewDirID
field and by settingioNewName
toNIL
.PBCatMove
function cannot move a file or directory to another volume (that is,ioVRefNum
is 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 forPBCatMove
are
Trap macro Selector _HFSDispatch $0005 RESULT CODES