Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Files /
Chapter 2 - File Manager / File Manager Reference
File System Specification Routines / Moving Files or Directories


FSpCatMove

You can use the FSpCatMove function to move a file or directory from one location to another on the same volume.

FUNCTION FSpCatMove (source: FSSpec; dest: FSSpec): OSErr;
source
An FSSpec record specifying the name and location of the file or directory to be moved.
dest
An FSSpec record specifying the name and location of the directory into which the source file or directory is to be moved.
DESCRIPTION
The FSpCatMove function moves the file or directory specified by the source parameter into the directory specified by the dest parameter. The directory ID specified in the parID field of the dest parameter is the directory ID of the parent of the directory into which you want to move the source file or directory. The name field of the dest parameter specifies the name of the directory into which you want to move the source file or directory.

Note
If you don't already know the parent directory ID of the destination directory, it might be easier to use the PBCatMove function, which allows you to specify only the directory ID of the destination directory.
The FSpCatMove function is strictly a file catalog operation; it does not actually change the location of the file or directory on the disk. You cannot use FSpCatMove to move
a file or directory to another volume (that is, the vRefNum field in both FSSpec parameters must be the same). Also, you cannot use FSpCatMove to rename files or directories; to rename a file or directory, use FSpRename.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for FSpCatMove are
Trap macroSelector
_HighLevelHFSDispatch$000C

RESULT CODES
noErr0No error
nsvErr-35No such volume
ioErr-36I/O error
bdNamErr-37Bad filename or attempt to move into a file
fnfErr-43File not found
wPrErr-44Hardware volume lock
fLckdErr -45Target directory is locked
vLckdErr-46Software volume lock
dupFNErr-48Duplicate filename and version
paramErr-50No default volume
badMovErr-122Attempt to move into offspring
wrgVolTypErr-123Not an HFS volume
afpAccessDenied-5000User does not have the correct access to the file

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996