cross platform directory scanning

N

Nazgob

Hello!
I'm looking for cross-platform directory scanning library working with
ansi C. I need to use in in GNU Linux and Windows. I need to do simple
directory and files opertionson both OS, can you recomend me some
solution? Thank you in advance.

Regards,
Nazgob
 
E

Emmanuel Delahaye

Nazgob wrote on 31/07/05 :
I'm looking for cross-platform directory scanning library working with
ansi C.

There are no directories at all in ISO-C. The best you can use are the
POSIX.1 portable functions like readdir(), opendir() etc.

--
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html
The C-library: http://www.dinkumware.com/refxc.html

I once asked an expert COBOL programmer, how to
declare local variables in COBOL, the reply was:
"what is a local variable?"
 
A

Alexei A. Frounze

Emmanuel Delahaye said:
Nazgob wrote on 31/07/05 :

There are no directories at all in ISO-C. The best you can use are the
POSIX.1 portable functions like readdir(), opendir() etc.

True. Gcc should have those (even DJGPP has). Borland compilers used to have
those POSIX *dir() functions and Watcom too. But Microsoft's VC++ doesn't
have them (at least not in v6.0).

Alex
 
N

Netocrat

True. Gcc should have those (even DJGPP has). Borland compilers used to have
those POSIX *dir() functions and Watcom too. But Microsoft's VC++ doesn't
have them (at least not in v6.0).

<OT>
An OS lecturer at my university used to frequently assert that Windows NT
was POSIX-compliant (I don't recall whether he qualified it with
"mostly"). He was pretty knowledgeable so no doubt there's truth to the
statement, but I've never investigated how much.
</OT>
 
A

Alexei A. Frounze

Netocrat said:
<OT>
An OS lecturer at my university used to frequently assert that Windows NT
was POSIX-compliant (I don't recall whether he qualified it with
"mostly"). He was pretty knowledgeable so no doubt there's truth to the
statement, but I've never investigated how much.
</OT>

I'd recommend everyone doing portable software look at what the Single Unix
Specification has (includes ANSI C and POSIX functions and others) and use
those. If they're not available on the target system, I believe, quite a bit
of them can be constructed out of what is there. Anyways, some compatibility
layer is due.

Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top