Important: The information in this document is obsolete and should not be used for new development.
PBHRename
You can use thePBHRenamefunction to rename a file, directory, or volume.
FUNCTION PBHRename (paramBlock: HParmBlkPtr; async: Boolean): OSErr;
paramBlock- A pointer to a basic HFS parameter block.
async- A Boolean value that specifies asynchronous (
TRUE) or synchronous (FALSE) execution.
--> ioCompletionProcPtrA pointer to a completion routine. <-- ioResultOSErrThe result code of the function. --> ioNamePtrStringPtrA pointer to a pathname. --> ioVRefNumIntegerA volume specification. --> ioMiscPtrA pointer to the new name for the file. --> ioDirIDLongIntA directory ID. DESCRIPTION
Given a pointer to the name of a file or directory inioNamePtr,PBHRenamechanges it to the name pointed to byioMisc. Given a pointer to a volume name inioNamePtror a volume reference number inioVRefNum, it changes the name of the volume to the name pointed to byioMisc.
- Note
- If a file ID reference exists for the file being renamed, the file ID remains with the file.
![]()
- IMPORTANT
- You cannot use
PBHRenameto change the directory in which a file
is located.![]()
ASSEMBLY-LANGUAGE INFORMATION
The trap macro forPBHRenameis_HRename.RESULT CODES