All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC/PATCH] Makefile: allow boards to check file size limits
Date: Tue, 19 Oct 2010 01:38:11 -0400	[thread overview]
Message-ID: <201010190138.13954.vapier@gentoo.org> (raw)
In-Reply-To: <20101019052444.9E043136320@gemini.denx.de>

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 

  reply	other threads:[~2010-10-19  5:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-14  2:58 [U-Boot] [RFC/PATCH] Makefile: allow boards to check file size limits Mike Frysinger
2010-10-18 20:43 ` Wolfgang Denk
2010-10-19  4:17   ` Mike Frysinger
2010-10-19  5:24     ` Wolfgang Denk
2010-10-19  5:38       ` Mike Frysinger [this message]
2010-10-19 21:29 ` Wolfgang Denk
2010-10-20  4:38   ` Vaibhav Bedia
2010-10-20  5:16     ` Mike Frysinger
2010-10-20  6:56       ` Vaibhav Bedia
2010-10-20  7:19         ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201010190138.13954.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.