Important: The information in this document is obsolete and should not be used for new development.
FSpRename
You can use theFSpRename
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 theFSpExchangeFiles
function instead.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector forFSpRename
are
Trap macro Selector _HighLevelHFSDispatch $000B RESULT CODES