473,492 Members | 4,301 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1033
<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
4216
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
8459
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
3474
by: Amit | last post by:
Which is more efficient and why? p++ or ++p. Thanks.
36
4559
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
1655
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
2608
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
1871
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
4423
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
1250
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
15501
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
7157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7192
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7364
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5452
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4886
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3087
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
282
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.