check if a subdirectory exists

  • Thread starter Diego Andres Alvarez Marin
  • Start date
D

Diego Andres Alvarez Marin

Hello all

How can I check if a subdirectory exists?

Regards,

Diego
 
T

Thomas Deschepper

Op Tue, 04 May 2004 02:17:25 -0700, schreef Diego Andres Alvarez Marin:
Hello all

How can I check if a subdirectory exists?

By posting to comp.os.linux.development.apps :)

mvg Thomas
 
T

Thomas Matthews

Thomas said:
Op Tue, 04 May 2004 02:17:25 -0700, schreef Diego Andres Alvarez Marin:




By posting to comp.os.linux.development.apps :)

mvg Thomas

That won't help me with my embbeded ARM processor
system that I am working on. Do you have any
suggestions?


--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
 
X

Xenos

Thomas Matthews said:
That won't help me with my embbeded ARM processor
system that I am working on. Do you have any
suggestions?


Search your C library headers for functions such as opendir, readir, etc.
These are POSIX functions and should suit your needs. Are you using
VxWorks? Look in the Reference Manual for the "dirLib."

DrX
 
J

Joona I Palaste

Search your C library headers for functions such as opendir, readir, etc.
These are POSIX functions and should suit your needs. Are you using
VxWorks? Look in the Reference Manual for the "dirLib."

Thomas, you need to be less subtle. Xenos missed your point.
 
T

Thomas Matthews

Xenos said:
Search your C library headers for functions such as opendir, readir, etc.
These are POSIX functions and should suit your needs. Are you using
VxWorks? Look in the Reference Manual for the "dirLib."

DrX

Sorry, but my embedded system is not running *nix.
Another hint: It doesn't have a file system.

So, how does opendir work on it?


--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
 
T

Thomas Matthews

Joona said:
Thomas, you need to be less subtle. Xenos missed your point.

Sorry, perhaps this will do:
I am running a simple operating loop on an embedded system that
does not have a harddrive. It has an ARM processor, a UART,
and SRAM. How do I use anybody's techniques for finding
subdirectories on my platform, especially when it doesn't
support any kind of filesystem?


--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
 
X

Xenos

Thomas Matthews said:
Sorry, but my embedded system is not running *nix.
Another hint: It doesn't have a file system.

So, how does opendir work on it?
I never said anything about any flavor of Unix. If it doesn't have a
filesystem, why do you care?
 
X

Xenos

Thomas Matthews said:
Sorry, perhaps this will do:
I am running a simple operating loop on an embedded system that
does not have a harddrive. It has an ARM processor, a UART,
and SRAM. How do I use anybody's techniques for finding
subdirectories on my platform, especially when it doesn't
support any kind of filesystem?
You flip your "stop being a c.l.c asshole" and just answer the poor guys
question.
 
J

Joona I Palaste

Xenos said:
You flip your "stop being a c.l.c asshole" and just answer the poor guys
question.

You stop insulting people and have another look at this thread, to see
that I answered his question long before you got into your little feud.
 
X

Xenos

Joona I Palaste said:
You stop insulting people and have another look at this thread, to see
that I answered his question long before you got into your little feud.

I never started any "little feud." I was just trying to answer to OP. I
didn't have that particular message (my server seems to drop a lot) and used
to one furthest up the thread. It was you who had to throw in a pompous
comment. I swear, posting here is like poking a bear with a stick.
 
J

Joona I Palaste

I never started any "little feud." I was just trying to answer to OP. I
didn't have that particular message (my server seems to drop a lot) and used
to one furthest up the thread. It was you who had to throw in a pompous
comment. I swear, posting here is like poking a bear with a stick.

Pardon me, which pompous comment? The one about ISO standard C not
supporting subdirectories (which is true), or about you missing
Thomas's point? The fact that you missed Thomas's point was Thomas's
fault, not yours. He should have told right out that his embedded
platform doesn't have a file system at all.
If people think that ISO standard C does not support subdirectories
is pompous, that's not going to magically make ISO standard C support
them. We can't change the language, we only discuss it. If you still
wish to make it support subdirectories, feel free to go over to
comp.std.c to discuss it with members of the standards committee.
 
K

Keith Thompson

Xenos said:
You flip your "stop being a c.l.c asshole" and just answer the poor guys
question.

No, you politely tell the poor guy that comp.lang.c is not the place
to ask about directories (which are not supported by the C standard),
and give him a hint about where to go to find the people who actually
can answer his question.

I've lost count of the number of times people have tried to be helpful
by answering off-topic questions in comp.lang.c, and ended up posting
system-specific misinformation. Misinformation is inevitable, but if
it's posted to an appropriate newsgroup it's more likely to be
corrected quickly.
 
M

Mark McIntyre

I never said anything about any flavor of Unix. If it doesn't have a
filesystem, why do you care?

You may take the view that /you/ can answer an OT question, so you should.

Wrong.

If you answer an offtopic question here, nobody knows if you're right or
wrong. The massive error in your answer will go unspotted. The OP will have
been given a misleading or even dangerous solution, which will result in a
train crashing, him being fired by his company. his aged father starving
and his daughters turing to prostitution. He will rightly blame you, and
one evening you'll open your front door to discover that you your memory
space is flat, due to that anvil he just dropped on it....
 
M

Martin Ambuhl

Xenos said:
You flip your "stop being a c.l.c asshole" and just answer the poor guys
question.
Why don't you flip your "stop being an asshole (unqualified" switch?
What's your next off-topic question going to be? Should we answer you
questions about whether viagra will give you pimples?
 
C

CBFalconer

Xenos said:
I never started any "little feud." I was just trying to answer
to OP. I didn't have that particular message (my server seems to
drop a lot) and used to one furthest up the thread. It was you
who had to throw in a pompous comment. I swear, posting here is
like poking a bear with a stick.

The OP has never reappeared. He probably took the excellent
original advice to ask in a group dealing with his system. It is
never wise, whether or not you believe you know the answer, to
reply to an off-topic query. Your answer will not normally be
vetted by others experienced in the subject, and thus errors will
not be caught.

If you know of a suitable group, I consider the best alternative
to be to quote the entire question, cross post it to that group,
and set follow-ups accordingly. Add a two liner saying what you
have done. Having done all that you can actually propose a
solution that may get properly vetted.
 
J

Jack Klein

Sorry, perhaps this will do:
I am running a simple operating loop on an embedded system that
does not have a harddrive. It has an ARM processor, a UART,
and SRAM. How do I use anybody's techniques for finding
subdirectories on my platform, especially when it doesn't
support any kind of filesystem?

Doesn't sound like much.

Our new ARM embedded controller has 6 UARTs, 3 CAN channels, USB 2.0,
SRAM, and SDRAM.

And it does have a file system, in FLASH, but it is completely of our
own devising. No <stdio.h> support, other than sprintf() and
snprintf(), is used.
 
A

August Derleth

and one evening you'll open your front door to discover that you your
memory space is flat, due to that anvil he just dropped on it....

Wouldn't that segment his memory into teeny tiny little pages?

August "Oh, and the segment tables are all munged" Derleth
 

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,141
Messages
2,570,818
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top