[U-Boot] [RFC/PATCH] Makefile: allow boards to check file size limits
Mike Frysinger
vapier at gentoo.org
Tue Oct 19 07:38:11 CEST 2010
On Tuesday, October 19, 2010 01:24:44 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > > > + @actual=`wc -c $@ | awk '{print $$1}'`; \
> > >
> > > How about using
> > >
> > > stat -c '%s'
> > >
> > > to get the file size in a single command, without need to actually
> > > read all the data?
> >
> > because `stat` isnt portable :(. it isnt part of the POSIX standard ...
> > OSX certainly does not support this, and i imagine most *BSD's dont.
>
> I see (well, at least FreeBSD 8.1 has "stat"; their man page claims it
> "appeared in NetBSD 1.6 and FreeBSD 4.10).
yes, but what i was referring to was the command line options. everyone has
`stat`, but it's really only the GNU stat that supports the '-c fmt' option
using the semantics necessary here. `wc -c` is going to work everywhere, but
i would need to figure out what OS i'm on and where `stat` is coming from so i
would know how to properly invoke it.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20101019/78d42511/attachment.pgp
More information about the U-Boot
mailing list