Hello Martijn, On Thu, Dec 15, 2016 at 01:42:45PM +0100, Martijn Verschoor wrote: > I’m looking for a way to list the files (nodes) in a directory using > a file system session. Amongst other, I studied the > File_system::Session and file_system/utils.h but cannot find a hook > to get started. I see that reading the directory nodes is supported > -> this returns the Directory_entry struct with information about > the directory itself, but not about the nodes the directory contains > (right?). Is there a way retrieve the latter?
You are on the right track, that reading directory entries (like in dirent()) is provided as read operation on directory nodes. Please have a look at os/src/lib/vfs/fs_file_system.h for an implementation of dirent(). The trick is to use n * sizeof(::File_system::Directory_entry) as file_offset parameter to read the n-th entry. Hope this helps -- Christian Helmuth Genode Labs https://www.genode-labs.com/ · https://genode.org/ https://twitter.com/GenodeLabs · /ˈdʒiː.nəʊd/ Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ genode-main mailing list genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main