All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frank Bormann <fbormann@yahoo.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] File system API: Read file size without reading file contents
Date: Wed, 22 Jan 2014 18:01:11 -0500	[thread overview]
Message-ID: <52E04DB7.80408@yahoo.com> (raw)

Hi All,

I would like to read a configuration file from an ext4 disk partition in u-boot and parse its contents. In order to malloc a buffer of sufficient size to read the entire file contents, I would need to know the file size before actually reading it.

As far as I understand, the current struct fstype_info API does not allow me to do that (other than parsing the ls output). While the read function does in fact return the file size, it does so only after the file was already read into memory. Lower level functions for ext4 such as ext4fs_open() do however provide this information before reading the file contents. Unless there is something that I have missed, how would you feel about me adding a .size function to the struct fstype_info API to expose this information on the top-level API?

Thanks,
Frank

             reply	other threads:[~2014-01-22 23:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-22 23:01 Frank Bormann [this message]
2014-01-23  2:59 ` [U-Boot] File system API: Read file size without reading file contents Simon Glass

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=52E04DB7.80408@yahoo.com \
    --to=fbormann@yahoo.com \
    --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.