PBHCopyFileSync
PBHCopyFile Duplicate a file, rename it if desired
#include <Files.h> File Manager (PBxxx)
OSErr PBHCopyFile(pb, async );
HParmBlkPtr pb ; address of a 52-byte CopyParam structure
Boolean async ; 0=await completion; 1=immediate return
returns Error Code; 0=no error
PBHCopyFile is an optional AppleShare routine that lets you make a copy of
a file on a file server and rename it if you want.
pb is the address of a 52-byte CopyParam structure. The following
fields are relevant:
Out-In Name Type Size Offset Description
-> ioCompletion ProcPtr 4 12 Completion routine address (if async =TRUE)
<- ioResult OSErr 2 16 Error Code (0=no error, 1=not done yet)
-> ioNamePtr StringPtr 4 18 Source pathname's address
-> ioVRefNum short 2 22 Source volume reference
-> ioDstVRefNum short 2 24 Destination volume reference
-> ioNewName StringPtr 4 28 Pointer to destination pathname
-> ioCopyName StringPtr 4 32 Address of optional name (NIL if not renaming)
-> ioNewDirID long 4 36 ID of the destination directory
-> ioDirID long 4 48 ID of the source directory
async is a Boolean value. Use FALSE for normal (synchronous) operation
or TRUE to enqueue the request and resume control immediately. See
Async I/O.
Returns: an operating system Error Code. It will be one of:
noErr (0) No error
nsvErr (-35) No such volume
fnfErr (-43) Either source file or destination directory not found
dupFnErr (-48) Destination file name already exists
paramErr (-50) No default volume
accessDenied (-5000) User has incorrect access level for either read or
write
denyConflict (-5006) Can't open source or destination file, access modes
incorrect

Notes: This routine lets you copy a file and rename it if you so desire. Copying
must be done on the same file server, although source and destination
volumes can be different.