My Project
|
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <unistd.h>
#include "include/backup.h"
#include "include/substitutions.h"
Functions | |
int | backupExistingFile (char *filename, char *backup_ext, char *status) |
int | fileCopy (char *filename1, char *filename2, char *status) |
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 |
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 |