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

Which is efficient?

P: n/a
Hi,
Which is efficient?
Checking whether the given path for Directory/file using stat or
Openinf the path using opendir

Thanks,
Ganesh Subramanian

Jul 23 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
<sg*******@yahoo.co.in> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Which is efficient?
Checking whether the given path for Directory/file using stat or
Openinf the path using opendir

1) There probably won't be much of a difference (same work to do
internally).
2) It will depend on the platform you are developing on
3) This is not a C++ question
4) This question does not belong to this newsgroup
5) All of the above
Ivan
--
http://ivan.vecerina.com/contact/?subject=NG_POST <- email contact form

Jul 23 '05 #2

P: n/a
> 1) There probably won't be much of a difference (same work to do
internally).
2) It will depend on the platform you are developing on
Thanks Ivan.
3) This is not a C++ question
4) This question does not belong to this newsgroup
5) All of the above


But the question is about the efficiecy of c/c++ functions. I have to
scan several thousands of directories in 'Unix' and want to check
whether the entry is directory or file.

Is there any other efficient way to determine the same.
Thanks,
Ganesh Subramanian

Jul 23 '05 #3

P: n/a
sg*******@yahoo.co.in wrote:
But the question is about the efficiecy of c/c++ functions. I have to
scan several thousands of directories in 'Unix' and want to check
whether the entry is directory or file.


What he means is that what you want to do is specific to a particular
OS. What you want to do is not covered in std C++ or the std c++ library.

He is telling you that this might not be the best place to get your
answer because the focus of this group is on standard C++ the language,
and standard C++ the library. AFAIK, neither knows about filesystems.

You might try a unix programmer group. I think there is a
comp.os.linux.development newsgroup...
Jul 23 '05 #4

P: n/a
<sg*******@yahoo.co.in> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
1) There probably won't be much of a difference (same work to do
internally).
2) It will depend on the platform you are developing on
Thanks Ivan.
3) This is not a C++ question
4) This question does not belong to this newsgroup
5) All of the above


But the question is about the efficiecy of c/c++ functions. I have to
scan several thousands of directories in 'Unix' and want to check
whether the entry is directory or file.

NB: Saying you are trying to scan directories is already a better
question (goal oriented open question instead of "A or B?").

C++ still has no functions dealing with the filesystem of a platform,
all it can do is open files specified by name. So you need to call
functions that are not in the C++ language.

You may also want to check the following peer-reviewed library
available on boost:
http://www.boost.org/libs/filesystem/doc/index.htm
Is there any other efficient way to determine the same.
Thanks,
Ganesh Subramanian


Kind regards, ;)
Ivan
--
http://ivan.vecerina.com/contact/?subject=NG_POST <- email contact form


Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.