Important: The information in this document is obsolete and should not be used for new development.
CatMove
You can use theCatMove
function 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
newName
is 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
TheCatMove
function moves a file or directory from one directory to another within a volume.CatMove
is strictly a file catalog operation; it does not actually change the location of the file or directory on the disk.The
newName
parameter 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 casenewDirID
should 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
newDirID
parameter and by settingnewName
to an empty name. To specify an empty name, setnewName
to':'
.CatMove
function cannot move a file or directory to another volume (that is, thevRefNum
parameter 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