[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [d-i] today's treecompare



On Mon, Oct 22, 2001 at 06:20:13PM -0600, Erik Andersen wrote:
> I did indeed re-enable wc.  But seriously though, if you know
> the file's name, couldn't you just stat(2)?  Something like: 
> 
>     struct stat statbuf;
>     ...
>     stat(filename, &statbuf);
>     filesize = statbuf.st_size;

Fine for C or Perl, but not for a sh script like debootstrap.

I posted some quick-and-dirty C source code for a tiny 'stat' program in
http://lists.debian.org/debian-boot/2001/debian-boot-200110/msg00728.html
which prints out all the statbuf fields, and might therefore be useful to
shell scripts:

$ ./stat /boot/vmlinuz-2.2.19
770 0 162419 33188 1 0 0 14199 0 457707 4096 904 1003569432 987719796 990575051

Easy to add to busybox, but definitely outside busybox's scope.  And no
longer needed, now that wc is back.

Regards,

Mark.



Reply to: