stat command filesize reporting on busybox
Posted
by
datadevil
on Server Fault
See other posts from Server Fault
or by datadevil
Published on 2012-01-20T15:48:42Z
Indexed on
2014/06/03
3:30 UTC
Read the original article
Hit count: 469
I'm trying to write a shell script in busybox to check the filesize of a file. Having read that stat is more reliable then ls, I decided to use that, but somehow when using the following command:
stat -c %s filename
I get the following output: 559795. This goes for the following 2 files (shown using ls -la):
0 Jan 20 16:32 foo_empty
4 Jan 20 16:32 foo_not_empty
Anyone know what's happening there? I can just go back to using ls, but I'm not understanding what's happening here, and that's bothering me..
© Server Fault or respective owner