Which is efficient?

S

sgane2001

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

Thanks,
Ganesh Subramanian
 
I

Ivan Vecerina

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
 
S

sgane2001

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
 
N

Noah Roberts

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...
 
I

Ivan Vecerina

Thanks Ivan.


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
 

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
474,201
Messages
2,571,048
Members
47,647
Latest member
NelleMacy9

Latest Threads

Top