I know that standard C doesn't give me any ability to do anything with folders, but I would like a fairly portable and cross-platform way to access folders. At this time, all I need to do is make a folder, check if a folder exists, and possibly delete a folder. I can forsee needing to read files from a folder in the near future, but that's not a very pressing need.
Anyway, I was wondering if there was a good cross-platform C library for working with directories. In an absolute pinch I can probably roll my own to work on POSIX and Windows, but I was wondering if there were any good ones already out there. I've been considering GLib or the Apache Portable Runtime, but both of those come with a lot more stuff than I really need, and I'd like to keep this fairly lightweight. I've also considered using the internals of a popular scripting language, like Perl or Python, but that also seems like a lot of overhead just for directory functions.
If anyone has anything to add to this list that I should look into, or wants to make a good case for one of the options I've already listed, please tell me. I don't want to sound like I'm asking for code, but if you posted a simple function like int direxist(char *dirname)
that returned true if the directory exists and false otherwise, just to illustrate the API for your library of choice, that would be really awesome, and I imagine not too hard. If you want to advocate using POSIX/rolling my own, do that too, because I'm a sucker for learning new stuff like this by doing it myself.
Just to make sure, I want C, not C++. I'm sure boost is good, but I'm not interested in C++ solutions.