A Simpler Safe-Save Strategy
When the user saves a changed version of a document, most applications
perform a "safe save"-a sequence of updating, renaming, saving, and deleting
files that preserves the contents of the old file until the new version is safely
recorded. Typically, an application saves the new version of the file under a
temporary name, renames both files, and then discards the original.
functions, which simplify a safe save. Both functions exchange the contents of
two files by altering the catalog entries for the files. To save a new version of a
file using file ex change, you save the copy, exchange the contents of the two
files, and discard the newly saved file, which now holds the original version of
the file. See Updating Files under the section,
used by the Alias Manager. (See File IDs under the section en titled See see the section called Alias Manager for a description of the underlying software.) Although the Alias Manager is usually able to resolve an alias with an obsolete file ID, you can improve the reliability of aliases by
preserving file IDs on all saves.