File size was cast to a signed integer which displayed files over 2GB as
negative sizes on devices. Use a long long for printing instead which
matches the stat struct.
Change-Id: I0ec07f33716bb4c2e5d120633ed435f637238f46
Sorts file and directory names properly in 'ls'
+ accept group flags (e.g. '-ld' instead of '-l -d')
+ accept flags in any position on the command line (e.g. 'ls foo -l' works)
Change-Id: Idc24a69ae31fe0c13726d39892357ac89a8830db
Added the "total" line, which makes it easy to answer questions like,
"how the hell much space am I wasting on /data/dalvik-cache?".
Also fixed the -s filename output, which was showing mostly-full paths
when a simple filename was called for.
This may not be useful, and may actually be misleading since yaffs2
doesn't track the blocks used for each file (it just divides the length
down by 512). I'm submitting it because yaffs2 isn't the only
filesystem we'll ever use.
I also changed some sprintf to snprintf, mostly out of paranoid habit.