Important: The information in this document is obsolete and should not be used for new development.
PBHCopyFile
You can use thePBHCopyFile
function to duplicate a file and optionally to rename it.
FUNCTION PBHCopyFile (paramBlock: HParmBlkPtr; async: Boolean): OSErr;
paramBlock
- A pointer to a
copyParam variant of the 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. --> ioDstVRefNum
Integer
Destination volume identifier. --> ioNewName
Ptr
A pointer to the destination pathname (may be NIL
).--> ioCopyName
Ptr
A pointer to the file's new name (may be NIL
).--> ioNewDirID
LongInt
The destination directory ID. --> ioDirID
LongInt
The source directory ID. DESCRIPTION
ThePBHCopyFile
function duplicates a file on the specified volume and optionally renames it. It is an optional call for AppleShare file servers. Your application should examine the information returned by thePBHGetVolParms
function to see if the volume supportsPBHCopyFile
.For AppleShare file servers, the source and destination pathnames must indicate the same file server; however, the parameter block may specify different source and destination volumes on that file server. A useful way to tell if two file server volumes are on the same file server is to call the
PBHGetVolParms
function for each volume and compare the server addresses returned. The server opens source files with read/deny write enabled and destination files with write/deny read and write enabled.You specify the source file with the
ioVRefNum
,ioDirID
, andioNamePtr
fields. You specify the destination directory with theioDstVRefNum
,ioNewDirID
, andioNewName
fields. IfioNewName
isNIL
, the destination directory is the directory having IDioNewDirID
on the specified volume; ifioNewName
is notNIL
, the destination directory is the directory having the partial pathname pointed to byioNewName
in the directory having IDioNewDirID
on the specified volume.The
ioCopyName
field may contain a pointer to an optional string to be used in copying the file; if it is notNIL
, the file copy is renamed to the name specified inioCopyName
. The string pointed to byioCopyName
must be a filename, not a partial pathname.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector forPBHCopyFile
are
Trap macro Selector _HFSDispatch $0036 RESULT CODES