I was trying to include standard C library support in my o/s (ie creating functions like printf, fopen, etc)
But I was surprised because I didn't find any function (in the standards) allowing to make a directory listing...
Is there any?
For the list of the functions I use this link : http://www.utas.edu.au/infosys/info/documentation/C/CStdLib.html
The problem is that I wanted to use the C standards in my shell (for eg use scanf for command lines) but I can't do that if there are no functions for directory listing)
Directory listing
Re:Directory listing
If you go into the posix/unix domain, you'll get the functions: opendir, readdir, closedir, etc.
The best person to let us know would be Solar but I don't believe there are any directory operations in the plain C standard - I haven't seen any and I implemented a basic C library a while ago. Then, when I found out the limitations of a pure C library, I dumped that and started on a unix library.
I'm still working on it: http://www.djm.co.za/spoon/libUNIX.php
The best person to let us know would be Solar but I don't believe there are any directory operations in the plain C standard - I haven't seen any and I implemented a basic C library a while ago. Then, when I found out the limitations of a pure C library, I dumped that and started on a unix library.
I'm still working on it: http://www.djm.co.za/spoon/libUNIX.php
Re:Directory listing
things like globbing + findfirst / findnext (dos) etc are all vendor extensions.
-- Stu --
Re:Directory listing
No directory handling in the C standard lib, nope. It's up to the individual OS.
Every good solution is obvious once you've found it.