This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: opendir with empty directory name?


Hong,Zhichao wrote:
Hi, all,
I am wondering what is the behavior of opendir("") in eCos fileio
implementation? I am reading some code written by others. And the
comment says open the current directory then code is written as
opendir(""). And the code seems to work as documented. But should not this actually
be opendir("."). I search the POSIX and various compiler
implementation. It does not seem any of them support this kind of empty
directory. Is this an eCos bug or a feature?

Why not just use the POSIX standard path (".") and *not* rely on [possibly] non-standard behaviour.

If you've seen other code that uses "" to mean the current
directory, I'd postulate that code is incorrect or at the
very least, non portable.  Was this eCos code?  in CVS or
elsewhere?

--
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]