Comments (21)
from afsctool.
It's cosmetic, so obviously not a big deal.
The biggest reason to fix it is that when someone notices it for the first time, it is not immediately obvious that it's cosmetic, and people may get worried about possible data loss (afsctool
can be scary to use). I was certainly a bit worried until I realized that the byte count is correct.
As for 1024 vs 1000, it's really not a big deal. Most other command line tools, like ls -lh
, use 1024, so why not go with that? (The Finder uses 1000, which is annoying.)
from afsctool.
Can you check and close the issue if this now gets your approval? :)
from afsctool.
Sorry for the late response. I am not sure what is happening, but it still doesn't report sizes correctly. I double-checked that I am using the version I just built (and the source I just downloaded).
For example, for the folder where I built it, it says
Folder size (uncompressed; reported size by Mac OS 10.6+ Finder): 1387738 bytes / 276.8 MB (megabytes, base-10)
Folder size (compressed - decmpfs xattr; reported size by Mac OS 10.0-10.5 Finder): 1387738 bytes / 276.8 MB (megabytes, base-10)
Folder size (compressed): 1387738 bytes / 264 MiB
from afsctool.
from afsctool.
I'm not really familiar with cmake, so all I did was
cmake .
make
It would complain about not finding sparsehash/dense_hash_map
, so I added /opt/local/include
to target_include_directories
, which seemed to work.
I built it on OS X 10.13.1 with the latest dev tools ("Apple LLVM version 9.0.0 (clang-900.0.38)")
from afsctool.
But since it's just a misreporting, it's really not a big deal.
from afsctool.
from afsctool.
Weird indeed. I can't see the problem in the function. Will look more later. Here the output is fine: http://coliru.stacked-crooked.com/a/e04c6526167906df
from afsctool.
I won't have more time for this today, but I put a printf
at the beginning of getSizeStr
to see what arguments it's getting, and I see this:
size: 1382668, size_rounded: 276824064
This doesn't look right. The problem seems to be with the size_rounded
value that's passed in.
from afsctool.
from afsctool.
from afsctool.
Yes, APFS.
I just tried on HFS+ (external drive) and it looks fine there:
size: 15329972233, size_rounded: 15330181120
Folder size (uncompressed; reported size by Mac OS 10.6+ Finder): 15329972233 bytes / 15.33 GB (gigabytes, base-10)
from afsctool.
from afsctool.
st_blksize
(for one file) is 4096 on the HFS+ volume I tried. On the APFS one it is 4194304 = 2^22. That explains the large reported sizes, but I do not know much about file systems, so I don't know what this value means in practice (I prefer not to guess in public :) )
from afsctool.
I find the code a bit too noisy to follow with confidence, but there are several repeated bits that seem to round up filesize
to a multiple of fileinfo->st_blksize
, like here:
filesize_rounded = filesize = fileinfo->st_size;
filesize_rounded += (filesize_rounded % fileinfo->st_blksize) ? fileinfo->st_blksize - (filesize_rounded % fileinfo->st_blksize) : 0;
from afsctool.
from afsctool.
I don't know the background context.
Do you mean that the whole purpose of this complicated calculation and rounding to "block sizes" (whatever those may be) is just to reproduce the Finder's results?
So you are asking to look at what the Finder reports on 10.13 / APFS and see which calculation it matches with?
from afsctool.
from afsctool.
from afsctool.
from afsctool.
Related Issues (20)
- Is this afsctool the clear successor to the original? Should the homebrew afsctool formula point here instead? HOT 4
- Does your afsctool support APFS? HOT 2
- Unable to build LZVN on apple m1 HOT 15
- building for macOS-x86_64 but attempting to link with file built for macOS-arm64 HOT 8
- About maintenance of the fork HOT 3
- Is this identical to 'brew install afsctool' or is that the original version? HOT 4
- Failed to build on M1 - Monterey 12.0.1 with Xcode 13.1 HOT 11
- Process stuck waiting HOT 12
- Are we ready for a new release? HOT 3
- Unable to build when the path to Xcode contains spaces HOT 3
- Build errors with GCC 5 HOT 9
- Recovering missing/deleted files HOT 4
- Time Machine risks? HOT 3
- Incorrect license HOT 4
- -t and -i options usage HOT 10
- afsctool breaks binaries, sometimes (HFS+) HOT 9
- Compress, decompress, compress results in lots of mismatch errors HOT 19
- compressing breaks app (workaround: restart mac) HOT 25
- Cannot build HOT 11
- Build problems with macOS Sonoma HOT 1
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 afsctool.