[BusyBox] bug#1115: BusyBox] bug#1115: ls reports file sizes half what it should
David Douthitt
ssrat at mailbag.com
Fri Mar 2 19:41:00 UTC 2001
Mark Whitley wrote:
> GNU ls: [testbed]
>
> $ ls -lh b*
> -rw-r--r-- 1 markw users 1.3k Feb 20 11:39 basename.c
> -rw-r--r-- 1 markw users 1.1k Mar 2 11:17 basename.o
> -rwxr-xr-x 1 markw users 152k Mar 2 11:18 busybox*
> -rw-r--r-- 1 markw users 4.0k Mar 2 10:43 busybox.c
> -rw-r--r-- 1 markw users 8.5k Mar 2 11:13 busybox.h
> -rw-r--r-- 1 markw users 820 Mar 1 11:51 busybox.links
> -rwxr-xr-x 1 markw users 517 Jan 26 13:53 busybox.mkll*
> -rw-r--r-- 1 markw users 6.2k Mar 2 11:18 busybox.o
> -rwxr-xr-x 1 markw users 309 Feb 20 11:39 busybox.sh*
> -rw-r--r-- 1 markw users 1015 Feb 14 11:57 busybox.spec
>
> Busybox ls before applying your patch:
>
> $ ./busybox ls -lh b*
> -rw-r--r-- 1 markw users 1.3k Feb 20 11:39 basename.c
> -rw-r--r-- 1 markw users 1.1k Mar 2 11:17 basename.o
> -rwxr-xr-x 1 markw users 152.3k Mar 2 11:18 busybox <-- * a bit off
> -rw-r--r-- 1 markw users 4.0k Mar 2 10:43 busybox.c
> -rw-r--r-- 1 markw users 8.5k Mar 2 11:13 busybox.h
> -rw-r--r-- 1 markw users 820 Mar 1 11:51 busybox.links
> -rwxr-xr-x 1 markw users 517 Jan 26 13:53 busybox.mkll
> -rw-r--r-- 1 markw users 6.2k Mar 2 11:18 busybox.o
> -rwxr-xr-x 1 markw users 309 Feb 20 11:39 busybox.sh
> -rw-r--r-- 1 markw users 1015 Feb 14 11:57 busybox.spec
>
> After applying your patch:
>
> $ patch < ls3.patch
> patching file `ls.c'
> $ make
> [snip]
>
> $ ./busybox ls -lh b*
> -rw-r--r-- 1 markw users 1.3k Feb 20 11:39 basename.c
> -rw-r--r-- 1 markw users 1.1k Mar 2 11:17 basename.o
> -rwxr-xr-x 1 markw users 152.3k Mar 2 11:38 busybox
> -rw-r--r-- 1 markw users 4.0k Mar 2 10:43 busybox.c
> -rw-r--r-- 1 markw users 8.5k Mar 2 11:13 busybox.h
> -rw-r--r-- 1 markw users 820 Mar 1 11:51 busybox.links
> -rwxr-xr-x 1 markw users 517 Jan 26 13:53 busybox.mkll
> -rw-r--r-- 1 markw users 6.2k Mar 2 11:18 busybox.o
> -rwxr-xr-x 1 markw users 309 Feb 20 11:39 busybox.sh
> -rw-r--r-- 1 markw users 1015 Feb 14 11:57 busybox.spec
>
> [Mark scratches head]
>
> I'm sorry, I don't see what the problem is or what your patch buys us. Would
> you mind posting a transcript of a shell session that shows wrong sizes being
> reported between GNU ls and Busybox ls?
I already did that, but here it is again (attached)...
I noticed that you used the "-h" option - isn't that
"BB_FEATURE_HUMAN_READABLE"? If that option is set, my patch looks like
it would have no effect.
-------------- next part --------------
ls (GNU fileutils) 4.0p
Written by Richard Stallman and David MacKenzie.
Copyright (C) 1999 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-rw-r--r-- 1 root root 1329 Feb 20 00:14 yes.c
#========================================
# BUSYBOX: before...
#========================================
BusyBox v0.50pre (2001.03.02-19:32+0000) multi-call binary -- GPL2
Usage: busybox [function] [arguments]...
or: [function] [arguments]...
BusyBox is a multi-call binary that combines many common Unix
utilities into a single executable. Most people will create a
link to busybox for each function they wish to use, and BusyBox
will act like whatever it was invoked as.
Currently defined functions:
busybox, cat, chgrp, chmod, chown, clear, cp, cut, date, dd, df,
dmesg, du, dutmp, false, fdflush, find, grep, gunzip, gzip, halt,
head, hostname, id, insmod, kill, killall, ln, loadkmap, logger,
ls, makedevs, md5sum, mkdir, mkfs.minix, mknod, mkswap, mktemp,
more, mount, mv, nslookup, ping, printf, rdate, renice, rm, rmdir,
rmmod, sort, swapoff, swapon, sync, tail, tar, tee, touch, tr,
true, umount, uname, uniq, update, uptime, usleep, wc, which,
whoami, xargs, zcat
-rw-r--r-- 1 root root 664 Feb 20 00:14 yes.c
#========================================
# BUSYBOX: after...
#========================================
BusyBox v0.50pre (2001.03.02-19:32+0000) multi-call binary -- GPL2
Usage: busybox [function] [arguments]...
or: [function] [arguments]...
BusyBox is a multi-call binary that combines many common Unix
utilities into a single executable. Most people will create a
link to busybox for each function they wish to use, and BusyBox
will act like whatever it was invoked as.
Currently defined functions:
busybox, cat, chgrp, chmod, chown, clear, cp, cut, date, dd, df,
dmesg, du, dutmp, false, fdflush, find, grep, gunzip, gzip, halt,
head, hostname, id, insmod, kill, killall, ln, loadkmap, logger,
ls, makedevs, md5sum, mkdir, mkfs.minix, mknod, mkswap, mktemp,
more, mount, mv, nslookup, ping, printf, rdate, renice, rm, rmdir,
rmmod, sort, swapoff, swapon, sync, tail, tar, tee, touch, tr,
true, umount, uname, uniq, update, uptime, usleep, wc, which,
whoami, xargs, zcat
-rw-r--r-- 1 root root 1329 Feb 20 00:14 yes.c
More information about the busybox
mailing list