FSpRename
FSpRename Change a file's name
#include <Files.h> File Manager
OSErr FSpRename (spec, newname) ;
FSSpec *spec; a pointer to an FSSpec record
Str255 newname; the file's new title
returns Error Code; 0=no error
FSpRename function changes the name of a file or directory.
spec is pointer to aa FSSpec record specifying the file to be renamed.
newname is the name you want the file to have.
Returns: an operating system Error Code. It will be one of:
noErr (0) No error
bdNamErr (-37) Bad file or volume name
dirFulErr (-33) Directory full
dupFNErr (-48) Duplicate filename (new name already exists)
extFSErr (-58) External file system
fLckdErr (-45) File is locked
fnfErr (-43) File not found
fsRnErr (-59) File system rename error
ioErr (-36) I/O error
nsvErr (-35) No such volume
paramErr (-50) Error in user parameter list
vLckdErr (-46) Volume is locked
wPrErr (-44) Diskette is write-protected

Notes: The FSpRename function unlocks a file. It is the high-level, FSSpec
version of the PBHRename function.