PBHMoveRenameSync
PBHMoveRename Move a file, folder, etc. and rename it if desired
#include <Files.h> File Manager (PBxxx)
OSErr PBHMoveRename(pb, async ); Boolean async ; 0=await completion; 1=immediate return PBHMoveRename lets you move a file within a file server volume and
rename it if you want.
pb is the address of a 40-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
-> 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.
noErr (0) No error
nsvErr (-35) No such volume
fnfErr (-43) Source pathname points to nonexistent object
dupFnErr (-48) Destination item name already exists
paramErr (-50) No default volume
badMovErr (-122) Tried to move dir into one of its offspring directories
accessDenied (-5000) User has incorrect access level to move the item
denyConflict (-5006) Can't open source or destination file, access modes
incorrect
Notes: The PBHMoveRename routine lets you move an object and rename it if
you so desire. Moving must be done on the same file server volume. If the
value in the ioCopyName field is NIL, the object can be moved but won't be
renamed. A string in ioCopyName renames the object to that string.