mirror of
https://github.com/gilbertchen/duplicacy
synced 2025-12-23 19:53:24 +00:00
ListFiles Don't delete or create directories in dryRun
This commit is contained in:
@@ -594,21 +594,21 @@ func (manager *SnapshotManager) ListAllFiles(storage Storage, top string) (allFi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if top == "chunks/" {
|
if !manager.config.dryRun {
|
||||||
// We're listing all chunks so this is the perfect place to detect if a directory contains too many
|
if top == "chunks/" {
|
||||||
// chunks. Create sub-directories if necessary
|
// We're listing all chunks so this is the perfect place to detect if a directory contains too many
|
||||||
if len(files) > 1024 && !storage.IsFastListing() {
|
// chunks. Create sub-directories if necessary
|
||||||
for i := 0; i < 256; i++ {
|
if len(files) > 1024 && !storage.IsFastListing() {
|
||||||
subdir := dir + fmt.Sprintf("%02x\n", i)
|
for i := 0; i < 256; i++ {
|
||||||
if !manager.config.dryRun {
|
subdir := dir + fmt.Sprintf("%02x\n", i)
|
||||||
manager.storage.CreateDirectory(0, subdir)
|
manager.storage.CreateDirectory(0, subdir)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
} else {
|
// Remove chunk sub-directories that are empty
|
||||||
// Remove chunk sub-directories that are empty
|
if len(files) == 0 && strings.HasPrefix(dir, "chunks/") && dir != "chunks/" {
|
||||||
if len(files) == 0 && strings.HasPrefix(dir, "chunks/") && dir != "chunks/" {
|
storage.DeleteFile(0, dir)
|
||||||
storage.DeleteFile(0, dir)
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user