TPCCLIB
|
Functions for file copying and making backup. More...
#include "libtpcmisc.h"
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) |
Functions for file copying and making backup.
Definition in file backup.c.
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.
filename | Name of file which, if it exists, is renamed to a backup file |
backup_ext | Extension for backup file; NULL will set the default ".bak" extension. |
status | Pointer to a string (allocated for at least 64 chars) where error message or other execution status will be written; enter NULL, if not needed |
Definition at line 14 of file backup.c.
Referenced by dftWrite(), fitWrite(), plot_fit_svg(), plot_fitrange_svg(), plot_svg(), plotdata(), and resWrite().
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.
filename1 | Name of file to be copied |
filename2 | Name of new file |
status | Pointer to a string (allocated for at least 64 chars) where error message or other execution status will be written; enter NULL, if not needed |
Definition at line 65 of file backup.c.