how to get the names of the files in a directory on the linux and windows platform

Ö

ÖÜÕÑÌÎ

hi,I want to get the names of the files in a directory on the linux and
windows platform.

I found that _findfirst(),_findnext() can work under windows but the code
cann't work under linux ,if some one have advice helpful ,thanks.

is there some class useful that can work under windows and linux without
much modification
 
R

Rob Williscroft

ÖÜÕÑÌÎ wrote in
hi,I want to get the names of the files in a directory on the linux
and windows platform.

I found that _findfirst(),_findnext() can work under windows but the
code cann't work under linux ,if some one have advice helpful ,thanks.

is there some class useful that can work under windows and linux
without much modification

Goto boost http://www.boost.org and use there filesystem library.

http://www.boost.org/libs/filesystem/doc/index.htm

It currently only supports 2 platform's windows & posix, but that covers
your requirement.

Alternativly your windows compiler may have some *nix compatibility,
Borland compilers for example have <dirent.h> which has opendir(),
readdir() etc.

HTH.

Rob.
 

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,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top