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 / Accessing Information About Files and Directories


FSpRename

You can use the FSpRename function to rename a file or directory.

FUNCTION FSpRename (spec: FSSpec; newName: Str255): OSErr;
spec
An FSSpec record specifying the file or directory to rename.
newName
The new name of the file or directory.
DESCRIPTION
The FSpRename function changes the name of a file or directory. If a file ID reference for the specified file exists, it remains with the renamed file.

SPECIAL CONSIDERATIONS
If you want to change the name of a new copy of an existing file, you should use the FSpExchangeFiles function instead.

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

RESULT CODES
noErr0No error
dirFulErr-33File directory full
dskFulErr-34Volume is full
nsvErr-35No such volume
ioErr-36I/O error
bdNamErr-37Bad filename
fnfErr-43File not found
wPrErr-44Hardware volume lock
fLckdErr -45File is locked
vLckdErr-46Software volume lock
dupFNErr-48Duplicate filename and version
paramErr-50No default volume
fsRnErr -59Problem during rename
dirNFErr-120Directory not found or incomplete pathname
afpAccessDenied-5000User does not have the correct access to the file

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996