Open Rudxain opened 1 year ago
Mind sending a patch?
Mind sending a patch?
Ok, I'll open a PR that uses stat
. I have no idea about its portability, but it seems simple and fast enough.
BTW, I have this
alias sizeof="stat -c '%s'"
In my .aliases
file. It seems the fs
function is more feature-rich, but I like to keep things simple (sometimes)
It uses
wc -c
which iterates over every single byte, when counting the size. I knowwc
is portable, but I suggest we use an alternative that does a syscall to fetch the size directly from the filesystem