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