Directory Access with C/C++

Started by
4 comments, last by Foxostro 15 years, 9 months ago
Is there any standered (not 3rd party) Librery in C++ that can be used to access directories like C the API. are the C API readdir() opendir() etc.. Cross Platform ??
Advertisement
Quote:Original post by nlbs
Is there any standered (not 3rd party) Librery in C++ that can be used to access directories like C the API.

No.
Quote:are the C API readdir() opendir() etc.. Cross Platform ??

No.

Use a third-party API like boost. That's what it's tere for.

Stephen M. Webb
Professional Free Software Developer

so the readdir() opendir() etc.. are Unix Specific ??
So how to access Directories on Window (No Native C API is there for Windows ??)
Quote:Original post by nlbs
so the readdir() opendir() etc.. are Unix Specific ??
So how to access Directories on Window (No Native C API is there for Windows ??)
I recommend the use of Boost as suggested above. That way, you'll only have to write the code once (rather than multiple times, once for each platform/API).
I believe that readdir, etc. are *nix system calls. They're definitely not standard C/C++ API's.

The Win32 equivalents would be FindFirstFile/FindNextFile.
-Mike
Directory access and file system access are a very OS specific sort of thing. I would recommend either using Boost Filesystem, or hitting up msdn.microsoft.com to try to find docs on the old Win32 API.

EDIT:
"The Win32 equivalents would be FindFirstFile/FindNextFile." Anon Mike beat me to it...

This topic is closed to new replies.

Advertisement