Important: The information in this document is obsolete and should not be used for new development.
PBHRename
You can use thePBHRename
function 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.
--> ioCompletion
ProcPtr
A pointer to a completion routine. <-- ioResult
OSErr
The result code of the function. --> ioNamePtr
StringPtr
A pointer to a pathname. --> ioVRefNum
Integer
A volume specification. --> ioMisc
Ptr
A pointer to the new name for the file. --> ioDirID
LongInt
A directory ID. DESCRIPTION
Given a pointer to the name of a file or directory inioNamePtr
,PBHRename
changes it to the name pointed to byioMisc
. Given a pointer to a volume name inioNamePtr
or 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
PBHRename
to change the directory in which a file
is located.ASSEMBLY-LANGUAGE INFORMATION
The trap macro forPBHRename
is_HRename
.RESULT CODES