mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jan Weitzel <J.Weitzel@phytec.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] read_file: Make it work on tftp servers which do not pass size
Date: Fri, 21 Jun 2013 09:10:38 +0200	[thread overview]
Message-ID: <20130621071038.GA32299@pengutronix.de> (raw)
In-Reply-To: <1371798211.2957.6.camel@lws-weitzel>

On Fri, Jun 21, 2013 at 09:03:31AM +0200, Jan Weitzel wrote:
> Am Donnerstag, den 20.06.2013, 17:24 +0200 schrieb Sascha Hauer:
> > 
> > How do you want to do that? You would have to transfer the whole file
> > first and see how big it is. That works for small files we expect to fit
> > into memory like the ones read_file normally is called with. If you want
> > to transfer a rootfs image it might happen that it's bigger than the
> > available memory.
> That's a good point. I didn't see a way for big files. But setting the
> st_size to FILESIZE_MAX can cause trouble in other commands. ubiformat
> only blames that is doesn't fit to eraseblock boundaries.

Have you tried it?

> ll -l shows a
> really big size.

You'll never see this. Listing directories is not implemented in the
tftp protocol.

> What do you think about handle it complete in read_file
> if size == 0?

Maybe. What happens if the file is really 0 bytes big?

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-06-21  7:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-19 20:58 Sascha Hauer
2013-06-19 21:32 ` Alexander Aring
2013-06-19 21:57   ` Alexander Aring
2013-06-20  6:42     ` Sascha Hauer
2013-06-20  7:28       ` Alexander Aring
2013-06-20  8:12         ` Sascha Hauer
2013-06-20 11:15 ` Jan Weitzel
2013-06-20 15:24   ` Sascha Hauer
2013-06-21  7:03     ` Jan Weitzel
2013-06-21  7:10       ` Sascha Hauer [this message]
2013-06-21  7:46         ` Jan Weitzel
2013-06-21  8:21           ` Sascha Hauer

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=20130621071038.GA32299@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=J.Weitzel@phytec.de \
    --cc=barebox@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox