Rebuild directories filenodes after copying
This commit is contained in:
@@ -47,7 +47,7 @@ typedef struct SActionQueueStatistics {
|
||||
long long deleteRight;
|
||||
} ActionQueueStatistics;
|
||||
|
||||
void ActionFileNode_Statistics(ActionFileNode actionFileNode,
|
||||
int ActionFileNode_Statistics(ActionFileNode actionFileNode,
|
||||
ActionQueueStatistics *statistics);
|
||||
|
||||
void ActionFileNode_Print(ActionFileNode actionFileNode);
|
||||
|
||||
@@ -18,6 +18,10 @@ FileTime FileTime_Get(char *filename);
|
||||
// Sets the current time in POSIX.
|
||||
void FileTime_Set(char *filename, FileTime t);
|
||||
|
||||
/////////////////////////////
|
||||
// FileTime_Print
|
||||
//
|
||||
// Prints the filetime
|
||||
void FileTime_Print(FileTime t);
|
||||
|
||||
///////////////////////////////////////////////
|
||||
|
||||
15
src/main.c
15
src/main.c
@@ -206,7 +206,7 @@ void PrintStatistics(ActionFileNode actionFileNode) {
|
||||
Print("Delete count : % 10d\n", statistics.deleteCount);
|
||||
}
|
||||
|
||||
int Sync(char *pathLeft, char *pathRight, int recheck, int dryRun) {
|
||||
int Sync(char *pathLeft, char *pathRight, int reCheck, int dryRun) {
|
||||
FileNode fileNodeLeft;
|
||||
FileNode fileNodeRight;
|
||||
|
||||
@@ -219,11 +219,11 @@ int Sync(char *pathLeft, char *pathRight, int recheck, int dryRun) {
|
||||
Print("Error, directory does not exist: %s\n", pathRight);
|
||||
return 0;
|
||||
}
|
||||
fileNodeLeft = CheckDir(pathLeft, recheck);
|
||||
fileNodeLeft = CheckDir(pathLeft, reCheck);
|
||||
if (!fileNodeLeft) {
|
||||
return 0;
|
||||
}
|
||||
fileNodeRight = CheckDir(pathRight, recheck);
|
||||
fileNodeRight = CheckDir(pathRight, reCheck);
|
||||
if (!fileNodeRight) {
|
||||
return 0;
|
||||
}
|
||||
@@ -244,8 +244,8 @@ int Sync(char *pathLeft, char *pathRight, int recheck, int dryRun) {
|
||||
else {
|
||||
// Run action list
|
||||
if (ActionFileNode_RunList(actionFileNode, pathLeft, pathRight)) {
|
||||
CheckDir(pathLeft, recheck);
|
||||
CheckDir(pathRight, recheck);
|
||||
CheckDir(pathLeft, reCheck);
|
||||
CheckDir(pathRight, reCheck);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -289,7 +289,10 @@ int Copy(char *pathLeft, char *pathRight, int reCheck, int dryRun) {
|
||||
}
|
||||
else {
|
||||
// Run action list
|
||||
ActionFileNode_RunList(actionFileNode, pathLeft, pathRight);
|
||||
if (ActionFileNode_RunList(actionFileNode, pathLeft, pathRight)) {
|
||||
CheckDir(pathLeft, reCheck);
|
||||
CheckDir(pathRight, reCheck);
|
||||
}
|
||||
}
|
||||
|
||||
return (1);
|
||||
|
||||
Reference in New Issue
Block a user