[syslinux] stat()

Ferenc Wagner wferi at niif.hu
Sun Mar 2 10:14:40 PST 2014

Gene Cumm <gene.cumm at gmail.com> writes:

> On Sun, Mar 2, 2014 at 3:53 AM, Ferenc Wagner <wferi at niif.hu> wrote:
>>> And an official stat() implementation would be very useful. After
>>> inventing mine, I noticed rosh also invented its own...
> #include <sys/stat.h>
> int stat(const char *path, struct stat *buf);
> I invented my own in rosh after not having one in the libraries based
> on what I thought was the most reasonable use of existing functions.

Yes, that's what I mentioned, but I can't find it in the library
modules, only in rosh.elf.  Or maybe I didn't get your point.  Could you
elaborate, please?

On the other hand, your implementation (as well as mine) calls open()
and opendir() to identify files and directories.  That more or less
works for everyday purposes (and FAT filesystems), but I wonder whether
there's more available power in dirent() in other filesystem drivers.
Maybe a searchdir()-based stat() implementation would be better from all
aspects, but I don't know enough about the internals to judge.

More information about the Syslinux mailing list