[GH-ISSUE #366] Use Size on Disk on Windows #165

Closed
opened 2026-06-08 11:25:57 +03:00 by zhus · 4 comments
Owner

Originally created by @pandaninjas on GitHub (Feb 6, 2024).
Original GitHub issue: https://github.com/bootandy/dust/issues/366

On Windows, Dust should use Size on Disk instead of Size, because OneDrive and other cloud storage providers can create files which do not take up space on the disk

Originally created by @pandaninjas on GitHub (Feb 6, 2024). Original GitHub issue: https://github.com/bootandy/dust/issues/366 On Windows, Dust should use Size on Disk instead of Size, because OneDrive and other cloud storage providers can create files which do not take up space on the disk
zhus closed this issue 2026-06-08 11:25:57 +03:00
Author
Owner

@sergeevabc commented on GitHub (Feb 18, 2024):

@pandaninjas, could you provide an example: the current output and the desired output?

<!-- gh-comment-id:1951420824 --> @sergeevabc commented on GitHub (Feb 18, 2024): @pandaninjas, could you provide an example: the current output and the desired output?
Author
Owner

@pandaninjas commented on GitHub (Feb 18, 2024):

@pandaninjas, could you provide an example: the current output and the desired output?

Example with my OneDrive folder
image
"Old Stuff" in reality is saved entirely to the cloud with no space used on disk
image

<!-- gh-comment-id:1951442754 --> @pandaninjas commented on GitHub (Feb 18, 2024): > @pandaninjas, could you provide an example: the current output and the desired output? Example with my OneDrive folder ![image](https://github.com/bootandy/dust/assets/101084582/7af83223-d771-4bc2-9245-b52d72cfac60) "Old Stuff" in reality is saved entirely to the cloud with no space used on disk ![image](https://github.com/bootandy/dust/assets/101084582/514414a7-18a8-4d29-b6cc-2c38d86cce20)
Author
Owner

@sergeevabc commented on GitHub (Feb 19, 2024):

Dear @bootandy, what do you think about that?

<!-- gh-comment-id:1951449158 --> @sergeevabc commented on GitHub (Feb 19, 2024): Dear @bootandy, what do you think about that?
Author
Owner

@bootandy commented on GitHub (Feb 19, 2024):

Hmm,

I softly agree with @pandaninjas

I don't have a windows box so it would be great if one of you wants to try experimenting with tweaking the code.

Size is read here for windows.
https://github.com/bootandy/dust/blob/master/src/platform.rs#L100

The API I'm using to read the size of the file in Windows is here:
https://doc.rust-lang.org/std/os/windows/fs/trait.MetadataExt.html#tymethod.file_size
(Although I can't see anything like 'size-on-disk' there).

I also think this would be a great place to utilize the 'use_apparent_size' flag: '-s' (currently only works on Linux & Mac). If we can bring it to windows that would be good.

So in summary, if it possible to do this then yes I'd accept a PR with this change (And ideally integrate the '-s' flag for windows too).

<!-- gh-comment-id:1953115452 --> @bootandy commented on GitHub (Feb 19, 2024): Hmm, I softly agree with @pandaninjas I don't have a windows box so it would be great if one of you wants to try experimenting with tweaking the code. Size is read here for windows. https://github.com/bootandy/dust/blob/master/src/platform.rs#L100 The API I'm using to read the size of the file in Windows is here: https://doc.rust-lang.org/std/os/windows/fs/trait.MetadataExt.html#tymethod.file_size (Although I can't see anything like 'size-on-disk' there). I also think this would be a great place to utilize the 'use_apparent_size' flag: '-s' (currently only works on Linux & Mac). If we can bring it to windows that would be good. So in summary, if it possible to do this then yes I'd accept a PR with this change (And ideally integrate the '-s' flag for windows too).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#165