Important: The information in this document is obsolete and should not be used for new development.
FSpRename
You can use theFSpRenamefunction to rename a file or directory.
FUNCTION FSpRename (spec: FSSpec; newName: Str255): OSErr;
spec- An
FSSpecrecord 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 theFSpExchangeFilesfunction instead.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector forFSpRenameare
Trap macro Selector _HighLevelHFSDispatch $000B RESULT CODES