By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,134 Members | 1,796 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,134 IT Pros & Developers. It's quick & easy.

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

P: n/a
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

Jul 22 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
wrote in news:bq**********@news.yaako.com:
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.
--
http://www.victim-prime.dsl.pipex.com/
Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.