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

listing directories and sub in C++

P: n/a
Hi,

I'd like to write a platform-indipendent method that lists all the files
contained in a directory.

Where do I start from?!

Thanks in advance
Salvo
Jul 23 '05 #1
Share this Question
Share on Google+
12 Replies


P: n/a

salvo wrote:
Hi,

I'd like to write a platform-indipendent method that lists all the files contained in a directory.


Directories are platform-dependent, so this is impossible.
Regards,
Michiel Salters

Jul 23 '05 #2

P: n/a
salvo wrote:
Hi,

I'd like to write a platform-indipendent method that lists all the
files contained in a directory.

Where do I start from?!

Thanks in advance
Salvo


See the filesystem library at www.boost.org.

Jeff
Jul 23 '05 #3

P: n/a
> I'd like to write a platform-indipendent method that lists* all the
files contained in a directory.


You can go for "C" type "findfirst() and findnext() functions. I don't
know they will be platform independent or not.

Tarun

Jul 23 '05 #4

P: n/a
ta*************@gmail.com wrote:
I'd like to write a platform-indipendent method that lists* all the
files contained in a directory.

You can go for "C" type "findfirst() and findnext() functions. I don't
know they will be platform independent or not.

Not only are they not platform independent, I can't even imagine what
platform those are for. Niether Windows nor any UNIX variant I am
familiar with use those.
Jul 23 '05 #5

P: n/a
Ron Natalie wrote:
You can go for "C" type "findfirst() and findnext() functions. I don't
know they will be platform independent or not.

Not only are they not platform independent, I can't even imagine what
platform those are for. Niether Windows nor any UNIX variant I am
familiar with use those.

Those ones are Win32 APIs functions. In fact they are the 2 of the 4
(all file system) Win32 API functions that I know. :-)


--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #6

P: n/a
Ioannis Vranos wrote:
Ron Natalie wrote:
You can go for "C" type "findfirst() and findnext() functions. I
don't know they will be platform independent or not.

Not only are they not platform independent, I can't even imagine
what platform those are for. Niether Windows nor any UNIX
variant I am familiar with use those.


Those ones are Win32 APIs functions. In fact they are the 2 of the 4
(all file system) Win32 API functions that I know. :-)


The Win32 API does not contain a function by either of those names.

They are platform independent: they don't work on any platform!

--
Later,
Jerry.

The universe is a figment of its own imagination.

Jul 23 '05 #7

P: n/a
Jerry Coffin wrote:
The Win32 API does not contain a function by either of those names.

They are platform independent: they don't work on any platform!

http://msdn.microsoft.com/library/en...ndfirsti64.asp

--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #8

P: n/a
Ioannis Vranos wrote:
Jerry Coffin wrote:
The Win32 API does not contain a function by either of those names.

They are platform independent: they don't work on any platform!


http://msdn.microsoft.com/library/en...ndfirsti64.asp

Yes..?

--
Later,
Jerry.

The universe is a figment of its own imagination.

Jul 23 '05 #9

P: n/a
Jerry Coffin wrote:
http://msdn.microsoft.com/library/en...ndfirsti64.asp

Yes..?

So they do exist.


--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #10

P: n/a

Ioannis Vranos wrote:
Jerry Coffin wrote:
The Win32 API does not contain a function by either of those names.

They are platform independent: they don't work on any platform!


http://msdn.microsoft.com/library/en...ndfirsti64.asp

That's _findfirst, intentionally with an _ to indicate it's not a
portable function.

Regards,
Michiel Salters

Jul 23 '05 #11

P: n/a
Ioannis Vranos wrote:
Jerry Coffin wrote:
http://msdn.microsoft.com/library/en...ndfirsti64.asp
Yes..?


So they do exist.


Look again -- and this time read more carefully. You should certainly
know by now that a C++ compiler won't ignore even the least visible
change in spelling.

Also take note that even when spelled correctly, none of these is part
of Win32 -- they're only parts of a library included with one
particular compiler that runs on Win32.

--
Later,
Jerry.

The universe is a figment of its own imagination.

Jul 23 '05 #12

P: n/a
Ioannis Vranos wrote:
Ron Natalie wrote:
You can go for "C" type "findfirst() and findnext() functions. I don't
know they will be platform independent or not.

Not only are they not platform independent, I can't even imagine what
platform those are for. Niether Windows nor any UNIX variant I am
familiar with use those.


Those ones are Win32 APIs functions. In fact they are the 2 of the 4
(all file system) Win32 API functions that I know. :-)

Nope, they are not. The WIN32 API's are FindFirstFile and FindNext (note
the capitalization). The are also some hack wrappers to these in the MSVC
runtimes that are called _findfirst() etc... but they are NOT part of the
WIN32 API.

Jul 23 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.