FSpExchangeFiles
FSpExchangeFiles Swap the files' data
#include <Files.h> File Manager
OSErr FSpExchangeFiles( source, dest);
FSSpec *source ; pointer to a source file
FSSpec *dest ; pointer to a target file
returns Error Code; 0=no error
FSpExchangeFiles swaps the files' data by changing the information in the
volume's catalog and, if the files are open, in the file control blocks.
source is a pointer to an FSSpec record specifying the source file.
dest is a pointer to an FSSpec specifying the file that will receive the
new data
Returns: an operating system Error Code. It will be one of:
noErr (0) No error
nsvErr (-35) Volume not found
ioErr (-36) I/O error
fnfErr (-43) File not found
fLckdErr (-45) File locked
volOffLinErr (-53) Volume is off line
extFSErr (-58) External file system
wrgVolTypErr (-123) Not an HFS volume
notAFileErr (-1302) Specified file is a directory
diffVolErr (-1303) Files on different volumes

Notes: The Tables in Updating Files under the section,
Using the File Manager, illustrate how FSpExchangeFiles alters the
catalog entries and file control blocks.
You should use FSpExchangeFiles when updating an existing file, so that
if the file is being tracked through its file ID, the ID remains valid.
Typically, you use PBExchangeFiles after creating a new file during a
safe save (see Updating Files under the section,
Using the File Manager,). You identify the two files to be ex changed in
the source and dest parameters. FSpExchangeFiles changes the fields in
the catalog entries that record the location of the data and the modification
dates. It swaps both the data forks and the resource forks.
FSpExchangeFiles works on either open or closed files. If either file is
open, FSpExchangeFiles updates any file control blocks associated with
the file. Exchanging the contents of two files requires essentially the same
access as opening both files for writing.
FSpExchangeFiles does not require that file IDs exist for the files being
ex changed.