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