blob: 676d3f071b9ed6e5e8226e5de3439a15d20fd381 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#ifndef _FILEUTIL_H
#define _FILEUTIL_H
#define FILE_BUF_SIZE 1024
#define DEFAULT_READ_PATH "logfile.txt"
#define NEW_FILE_PERMS 0664
#define MIN_NUM_OF_ARGS 1
#define MAX_NUM_OF_ARGS 6
typedef enum {false, true} bool;
typedef struct arguments_t {
bool valid;
bool move_flag;
bool force_flag;
bool dir_flag;
int src_path_index;
int dir_path_index;
} arguments_t;
void to_stdout(char *string);
void to_stderr(char *string);
int open_file(char *path, int flags);
void file_into_file(int source_fd, int dest_fd);
void print_file(char *read_path);
void copy_file(char *read_path, char *write_path, bool overwrite);
char* get_filename(char *full_path);
void copy_into_dir(char *file_path, char *dir_path);
int main(int argc, char *argv[]);
#endif
|