Comments (7)
That explains why the results are the same then.
Basically, diskus
can retrieve the metadata for a directory that can’t be read but can’t see the contents. Because the directories are empty, the size given in the metadata is the actual size of the directory, so everything works out.
However, if the directory contained other files, the reported size should include the size of the directory itself (which might be stuff like the number of entries and the permissions of the directory or whatever the OS decides to report) as well as the sizes of the files contained within (recursively). If diskus
can’t read the contents of the directory, it can’t determine the sizes of the files contained within, so it just reports the size of the directory itself. This would lead to a different final size, so diskus
displays warnings to indicate that the final reported size may not be completely accurate.
from diskus.
If the directories that can't be read are large enough, the results should be different. Are those directories empty?
from diskus.
Yes, they are.
from diskus.
It's just like @Arcterus said, yes.
We could potentially make this a bit more user-friendly, though. Maybe we could collect all access-errors while traversing the directory and then just print a single warning at the end that the result might be inaccurate since there were directories/files that could not be accessed.
from diskus.
I think it would be better to put the current behavior behind a --verbose
flag and default to just mentioning the size may be inaccurate.
from diskus.
put the current behavior behind a
--verbose
flag
Yes, sounds good.
default to just mentioning the size may be inaccurate.
That's what I wanted to suggest, exactly. But I would only show the "may be inaccurate" warning if there were any I/O errors while traversing the directory.
from diskus.
Ah, that was what I meant. I should have been clearer.
from diskus.
Related Issues (20)
- Export this project as a library HOT 5
- No boilerplate copyright notice HOT 3
- Please publish Cargo.lock with the crate HOT 7
- Difference in size reported by `du -sh` and diskus HOT 4
- Support resident size as well as apparent size or clarify description HOT 4
- Stack overflow HOT 4
- Missing manpage HOT 1
- Support Windows as target OS HOT 8
- Add plain output option HOT 2
- diskus slower than du HOT 11
- There is no --exclude=/path HOT 1
- Provide path in output HOT 1
- Handling junctions in Windows HOT 1
- Undocumented stdout behaviour HOT 1
- Add an option to follow symlinks HOT 1
- Please upgrade the version of libc in Cargo.lock HOT 1
- [Feature] Support hidden, ignore-files HOT 1
- Consider adding support for Windows directory size "philosophy" HOT 6
- Progress bar and / or current copy speed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from diskus.