This script contains a class that enables a client to securely update an existing file, including the ability to make an automated backup version.

This code enn existing file, including the ability to make an automated backup version.

This code encapsulates the method to safely update files in-place, by first writing to a temporary file and finally renaming the new temporary file to the old filename. This also make it possible to create a backup copy of the original file.

The "FileMorpher" class encapsulates all the necessary steps, including the filename handling, which makes the calling code much cleaner as opposed to the naive approach where all the gory details are spread over that higher-level code.


Download from: Homepage




Author:
admin
Time:
Wednesday, June 4th, 2008 at 10:24 am
Category:
Uncategorized
Comments:
You can leave a response, or trackback from your own site.
RSS:
You can follow any responses to this entry through the RSS 2.0 feed.
Navigation:

Leave a Reply