Scripts Index
Related Topics
Popular Trends
Trending Topics
Python File Management  

Safely morph a file in-place

download download home home   report broken
important script information
company name:
code.activestate.com
license: Free
minimum requirements: Python
functional limitations:
Safely morph a file in-place description


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 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.



Relates:
Update - File - Backup - File Manipulation - File Update - File Backup
Similar scripts
Convert PDF to TIFF (Popularity: ) : This script is a very short code snippet illustrating how to convert individual pages of PDF documents to TIFF files, one TIFF file per page. It works only on Mac OS X with PyObjC installed.As a recipe the code is ...
Count PDF pages (Popularity: ) : Count PDF pages script is a simple way to count the pages of a PDF the pure Python way.
Iterate over .MP4 atoms (Popularity: ) : This script yields the atoms contained in an MP4 file. Mostly is used for extracting the tags contained in it (artist, title etc) using a convenience class (M4ATags). This script could be implemented as an generator.
Counting pages of PDF documents on Mac OS X (Popularity: ) : Given that PDF is a "native" data format on Mac OS X, it is very easy to get access to some properties of such documents. One is the number of pages. Using Python the necessary code to do this is ...
Counting pages of PDF documents on Mac O (Popularity: ) : Given that PDF is a "native" data format on Mac OS X, it is very easy to get access to some properties of such documents. One is the number of pages. Using Python the necessary code to do this is ...
Disk (Popularity: ) : This script provides a simple simulation of secondary memory and is primarily designed to provide a driver interface to a virtual hard drive. The interface is simple and allows the simulation of IO errors. Also provided are methods that allow ...
Cross Platform Excel Parsing With Xlrd (Popularity: ) : This script easily extract data from microsoft excel files using this wrapper class for xlrd. The class allows you to create a generator which returns excel data one row at a time as either a list or dictionary. This script ...
A Singleton log file creator (Popularity: ) : This class is a basic Singleton log file creator. It allows separate classes/modules to log their activities to the same file (even the same line if they want to).This is a quite basic log file creator, intended to assist in ...
Backup your files (Popularity: ) : Backup your files script makes backup versions for your files.It can be used for non-python source code also.
Handling of command line arguments (Popularity: ) : This script handles arguments for small scripts that need to: - read some command line options - read some command line positional arguments - iterate over all lines of some files given on the command line, or stdin if none ...
User reviews

Write a review:
1 2 3 4 5 6 7 8 9 10
1=poor 10=excellent
Write review*
Your name*
Email*
  (Comments are moderated, and will not appear on this site until the editor has approved them)
 
Similar Software
View OST File in Outlook 2007 (Popularity: ) : View OST File in Outlook 2007 with SysTools OST Recovery Software. OST to PST Software is the solution for Offline Storage Table (.OST) files to easily recover and convert into Personal Storage Table (.PST) file. OST File in Outlook Software ...
A Sitch in Time (Popularity: ) : A Sitch in Time 2 is an interesting adventure game for free. The goal for you is to travel into the past to stop the villains from crushing KimOCOs spirit. In the game, use four arrow keys to control Kim. ...
Restore PST File in Outlook (Popularity: ) : Perfect Data Solution introduces best PST Recovery software which is most pre-eminent solution to restore PST File in Outlook and repair corrupt outlook PST file. PDS PST repair tool having fully automatic scanning process which can immediately recover single or ...
Large OST File in Outlook (Popularity: ) : Large OST File in Outlook Software does recover your lost, deleted emails from corrupted OST files & software also convert tasks, notes, calendar, journals, drafts, deleted emails files. OST to PST Software allows you for OST file recover with all ...
Open Corrupt OST File in Outlook (Popularity: ) : Open corrupt OST file in Outlook application management tool solves Outlook client quires like how to open error OST file in Outlook for the reason that Open Corrupt OST File in Outlook software with no trouble change OST file to ...
Open OST File in Outlook 2010 (Popularity: ) : It can easily possible to open your all OST files to PST format with our OST Recovery Software. Open OST File in Outlook 2010 Tool is especially trouble-free to use and it's easily recover and open OST file into PST ...
Convert .OST File in Outlook (Popularity: ) : PCVITA software presents an unbeatable solution to convert .OST file in Outlook 2010 to make offline OST file accessible. No need to worry about unusable OST file if Exchange server goes down and stops working. Convert .OST file in Outlook ...
Convert EML File in Outlook PST File (Popularity: ) : Have you decided to move Windows Live Mail/Windows Mail to Outlook and import all content of Windows Live Mail/Windows Mail into MS Office Outlook 2003/2007/2010? If your answer is yes then try our smart and perfect Windows Live Mail Converter ...
Hashy - A file checksum tool (Popularity: ) : The easiest way to generate MD5, SHA1, SHA256 and SHA512 checksums! Simple drag the a file into the application and the checksum will be instantly generated. Along with the simple 'copy to clipboard' button, it could not be easier!<br /><br ...
Convert 2007 OST to PST (Popularity: ) : - Are you in stress & want to decrease spininess about how to recover OST Outlook 2007? So just take amazing OST PST converter 2007 tool which can fix Outlook OST file 2007 & recover corrupted OST file 2007 PST ...
ad


Rate me
supported os
All
stats
downloads 5
version 1.0
size in Kb
popularity   
961/367580
user rating 0/10
New Scripts
Popular Scripts
Latest Reviews