Functions
backup.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int backupExistingFile (char *filename, char *backup_ext, char *status)
int fileCopy (char *filename1, char *filename2, char *status)

Function Documentation

int backupExistingFile ( char *  filename,
char *  backup_ext,
char *  status 
)
Check if specified file exists; rename existing file to a backup file.
If also backup file exists, then remove that.
Returns:
Returns 0, if successful, and <> in case of an error.
Parameters:
filenameName of file which, if it exists, is renamed to a backup file
backup_extExtension for backup file; NULL will set the default ".bak" extension.
statusPointer to a string (allocated for at least 64 chars) where error message or other execution status will be written; enter NULL, if not needed
int fileCopy ( char *  filename1,
char *  filename2,
char *  status 
)
Copy file contents to another file. Existing file will be overwritten,
to prevent it call backupExistingFile() before calling this function.
Returns:
Returns 0 if successfull, otherwise >0.
Parameters:
filename1Name of file to be copied
filename2Name of new file
statusPointer to a string (allocated for at least 64 chars) where error message or other execution status will be written; enter NULL, if not needed