diff options
author | andy.boot <bootandy@gmail.com> | 2022-02-27 10:32:21 +0000 |
---|---|---|
committer | andy.boot <bootandy@gmail.com> | 2022-02-27 11:01:31 +0000 |
commit | 1a48c5db61a763105c6e0fa83b6b0ae0df19668c (patch) | |
tree | 7d6403bb5015024da6ec2934bdd8669acd8b5448 | |
parent | a18f90ca0f2d714a503bd0f35dedaa8c1bfbd70a (diff) |
Windows: Do not filter archive directoriesv0.8.1-alpha.2
I do not have a windows box so this is hard to test. But my guess is
that issues like this have been caused by archive directories being
ignored. This may fix this.
https://github.com/bootandy/dust/issues/153
-rw-r--r-- | src/platform.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/platform.rs b/src/platform.rs index c8b7525..3935776 100644 --- a/src/platform.rs +++ b/src/platform.rs @@ -105,7 +105,6 @@ pub fn get_metadata(d: &Path, _use_apparent_size: bool) -> Option<(u64, Option<( use std::os::windows::fs::MetadataExt; match d.metadata() { Ok(ref md) => { - const FILE_ATTRIBUTE_ARCHIVE: u32 = 0x20u32; const FILE_ATTRIBUTE_READONLY: u32 = 0x1u32; const FILE_ATTRIBUTE_HIDDEN: u32 = 0x2u32; const FILE_ATTRIBUTE_SYSTEM: u32 = 0x4u32; @@ -114,8 +113,7 @@ pub fn get_metadata(d: &Path, _use_apparent_size: bool) -> Option<(u64, Option<( let attr_filtered = md.file_attributes() & !(FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM); - if attr_filtered == FILE_ATTRIBUTE_ARCHIVE - || attr_filtered == FILE_ATTRIBUTE_DIRECTORY + if attr_filtered == FILE_ATTRIBUTE_DIRECTORY || md.file_attributes() == FILE_ATTRIBUTE_NORMAL { Some((md.len(), None)) |