Page 1 of 1

Directory listing

Posted: Tue Apr 18, 2006 5:12 am
by CyberP1708
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)

Re:Directory listing

Posted: Tue Apr 18, 2006 5:58 am
by durand
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

Re:Directory listing

Posted: Wed Apr 19, 2006 5:40 am
by df
things like globbing + findfirst / findnext (dos) etc are all vendor extensions.

Re:Directory listing

Posted: Wed Apr 19, 2006 2:33 pm
by Solar
No directory handling in the C standard lib, nope. It's up to the individual OS.