mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Don't attempt to compress files smaller than the cluster size.
This commit is contained in:
parent
d828b5b0ff
commit
4b837d83bb
@ -60,11 +60,17 @@ namespace Wabbajack.Common
|
|||||||
|
|
||||||
public static async Task CompactFolder(this AbsolutePath folder, WorkQueue queue, Algorithm algorithm)
|
public static async Task CompactFolder(this AbsolutePath folder, WorkQueue queue, Algorithm algorithm)
|
||||||
{
|
{
|
||||||
|
var driveInfo = folder.DriveInfo().DiskSpaceInfo;
|
||||||
|
var clusterSize = driveInfo.SectorsPerCluster * driveInfo.BytesPerSector;
|
||||||
|
|
||||||
await folder.EnumerateFiles(true)
|
await folder.EnumerateFiles(true)
|
||||||
.PMap(queue, async path =>
|
.PMap(queue, async path =>
|
||||||
|
{
|
||||||
|
if (path.Size > clusterSize)
|
||||||
{
|
{
|
||||||
Utils.Status($"Compacting {path.FileName}");
|
Utils.Status($"Compacting {path.FileName}");
|
||||||
await path.Compact(algorithm);
|
await path.Compact(algorithm);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user