Important: The information in this document is obsolete and should not be used for new development.
CatMove
You can use theCatMovefunction to move files or directories from one directory to another on the same volume.
FUNCTION CatMove (vRefNum: Integer; dirID: LongInt; oldName: Str255; newDirID: LongInt; newName: Str255): OSErr;
vRefNum- A volume reference number, a working directory reference number, or 0 for the default volume.
dirID- A directory ID.
oldName- An existing filename or directory name.
newDirID- If
newNameis empty, the directory ID of the target directory; otherwise, the parent directory ID of the target directory.newName- The name of the directory to which the file or directory is to be moved.
DESCRIPTION
TheCatMovefunction moves a file or directory from one directory to another within a volume.CatMoveis strictly a file catalog operation; it does not actually change the location of the file or directory on the disk.The
newNameparameter specifies the name of the directory to which the file or directory is to be moved. If a valid directory name is provided fornewName, the destination directory's parent directory is specified innewDirID. However, you can specify an empty name fornewName, in which casenewDirIDshould be set to the directory ID of the destination directory.
The
- Note
- It is usually simplest to specify the destination directory by passing its directory ID in the
newDirIDparameter and by settingnewNameto an empty name. To specify an empty name, setnewNameto':'.![]()
CatMovefunction cannot move a file or directory to another volume (that is, thevRefNumparameter 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, useHRename.RESULT CODES