472,779 Members | 1,807 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,779 software developers and data experts.

Which is efficient?

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
4 1025
<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
> 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
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
<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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Randell D. | last post by:
Folks, I have a large amount of values to store (we're talking tens, if not hundreds of bytes). I need this for a client side application - ignore the security consequences for the moment -...
2
by: Vance M. Allen | last post by:
Greetings, I am establishing a database for the purpose of logging access to my secure webserver and am wanting to make the database as efficient as I can because it will be doing a lot of work...
10
by: Amit | last post by:
Which is more efficient and why? p++ or ++p. Thanks.
36
by: Vivek Mandava | last post by:
Hello All, Which one is an expensive operation? '>' or '==" ? I know this won't matter much. However, if I'm executing this operation million times, I would prefer the better choice. My...
16
by: Dustan | last post by:
I have a program that uses up a lot of CPU and want to make it is efficient as possible with what I have to work with it. So which of the following would be more efficient, knowing that l is a list...
2
theGeek
by: theGeek | last post by:
I always wonder which one of join or subquery should I be using to solve a particuar problem so that I get the correct result set in minimum time. It usually happens that I can write a query quickly...
19
by: santanu mishra | last post by:
Hi , I am stuck with a requirement from my client to change the date format from mm/dd/yy to dd/mm/yy .If any body can help me out with this regard as its very much urgent. Regards,...
50
by: Juha Nieminen | last post by:
I asked a long time ago in this group how to make a smart pointer which works with incomplete types. I got this answer (only relevant parts included): ...
6
by: Christopher | last post by:
I've seen various ways of doing this, but what I want is to be able to take a base class pointer and know which derived class to cast to. For example I am going to make a base light class, that...
25
by: Abubakar | last post by:
Hi, recently some C programmer told me that using fwrite/fopen functions are not efficient because the output that they do to the file is actually buffered and gets late in writing. Is that...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.