dclean/dclean.h

52 lines
1.2 KiB
C
Executable File

#ifndef DCLEAN_H_
#define DCLEAN_H_
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <dirent.h>
#include <sys/dir.h>
void run_external_process(int pipe[2], const char** args);
int find_directories(char * file_path, char * out_name);
int sortfile(char *inputfile, char *outputfile);
int identical(char * file1, char * file2);
void list_directory (char * path , char * filename);
void find_same();
void clean_txt();
/*
* dclean <master directory> <copy directory>
*
* A/ B/ # A/excursion.jpg
* excursion.jpg == 123.jpg => rm B/123.jpg
*
*
* | Addon/ |
* | |
* | xyz.txt |
* | |
* | |
* | .. |
* | . |
* V V
* dclean-master.txt dclean-copy.txt
* [ 1024 | A/excursion.jpg] [ 1024 | B/123.jpg]
* [ 127 | A/Addon/xyz.txt] [ | ]
*
* if filesize A == filesize B then
*
* if they are the same add to the to_be_deleted_list
*
* fork and exec "diff" to see if the same
*
*/
#endif /* DCLEAN_H_ */