Directory listing

Programming, for all ages and all languages.
Post Reply
CyberP1708

Directory listing

Post 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)
durand
Member
Member
Posts: 193
Joined: Wed Dec 21, 2005 12:00 am
Location: South Africa
Contact:

Re:Directory listing

Post 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
User avatar
df
Member
Member
Posts: 1076
Joined: Fri Oct 22, 2004 11:00 pm
Contact:

Re:Directory listing

Post by df »

things like globbing + findfirst / findnext (dos) etc are all vendor extensions.
-- Stu --
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Directory listing

Post by Solar »

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.
Post Reply