Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I enumerate all the file in a directory in vfs c or c++?
    primarykey
    data
    text
    <p>I need to enumerate all the file in a folder and then navigate to the subfolder and do the same (recursion? sure).</p> <p>Ideally the algorithm should work in the same way on linux &amp; macos</p> <p>DISCLAIMER: I have asked a similar question on POSIX: I'm now aware of VFS but I'm puzzled to use VFS for enumerate dir. Any suggestion ? Should I open a dir as file ? The only way is to use a library cross platform like qt ?</p> <p>UPDATE: so no <strong>VFS</strong> way to work on directory? "*<em>V</em>*irtual *<em>F</em>*ile *<em>S</em>*ystem provides a single API for accessing various different file systems" but no way to enumerate directory. </p> <p>The "readdir" etc solution will do the trick on any type of *NIX ? And on windows nothing better than the huge MingW lib? or partial impletion working on only some win like: <a href="https://github.com/xbmc/xbmc/blob/master/tools/TexturePacker/Win32/dirent.c" rel="nofollow">https://github.com/xbmc/xbmc/blob/master/tools/TexturePacker/Win32/dirent.c</a></p> <p>The BOOST seem to be a really cool solution but it's complex and academic. thnks in any case</p> <p><strong>LAST UPDATE</strong>:<br> I have found some more doc and now everything is a lot more clear. <strong>This question is a duplicate!</strong> opendir() and readdir() are the solution to enumerate and browse directory on linux. As shown on my example is quite easy to map them on windows (but the incoerent windowz fs make everything strange) and ntfw() is even more useful. </p> <p><strong>VFS</strong> (the virtual file switch) is a kernel feature that resolves this problem by creating an abstraction layer for file-system operations. closed doc here: <a href="http://my.safaribooksonline.com/book/programming/linux/9781593272203/file-systems/the_virtual_file_system_open_parenthesis" rel="nofollow">linux programming interface</a></p> <p>thnks!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload