I'm looking for an implementation of these 2 Win32 functions.
FindFirstFile saerches a directory for a file whose name matches the
specified filename (or pattern),
FindNextFile continues a file search from a previous call to the
FindFirstFile (above) function.
I know, I could play with scandir(3) and some source code of bash
(glob.c) but I would like not to re-invent the wheel ;-)
Tia
Meir
Meir Dukhan <me...@bis.co.il> wrote:
--
Reinhold J. Gerharz http://www.erols.com/rgerharz/
PGP Key at http://www.erols.com/rgerharz/pgp/public-key.asc
"The only good spammer is a DEAD spammer!" - Anonymous
Isn't that a BSD-ism? In any case, it does not do pattern globbing,
so you might as well use the POSIX functions opendir(), readdir()
et al.
For pattern matching, you want the POSIX.2 glob() function.
Thanks for your answer,
Could you please tell me if scandir(3) is POSIX.2 ?
Tia
Meir
>>>>> "Meir" == Meir Dukhan <me...@bis.co.il> writes:
Meir> Could you please tell me if scandir(3) is POSIX.2 ?
I don't believe so; I think it's a BSDism. It's not in the Single Unix
specs.
fnmatch() is, though (both Posix.2 and the Unix spec), and
Find{First,Next}File can be implemented fairly straightforwardly using
opendir(), readdir(), and fnmatch().
If someone wants to submit an example for the FAQ, or even just a
specification for FindFirst/FindNext so I can whomp up an example,
then feel free.
--
Andrew.
comp.unix.programmer FAQ: see <URL: http://www.erlenstar.demon.co.uk/unix/>
or <URL: http://www.whitefang.com/unix/>
> > In article <34e8c7bc....@news.erols.com>,
> > Reinhold J. Gerharz <rger...@erols.com> wrote:
> > >Your in luck! UNIX has getdirentries(), which will get a whole bunch
> > >of files in one system call.
> >
> > Isn't that a BSD-ism? In any case, it does not do pattern globbing,
> > so you might as well use the POSIX functions opendir(), readdir()
> > et al.
> >
> > For pattern matching, you want the POSIX.2 glob() function.
> Thanks for your answer,
> Could you please tell me if scandir(3) is POSIX.2 ?
``CONFORMING TO BSD 4.3''
--
========================================================================
Bob Nelson -- Dallas, Texas, USA (bne...@iname.com)
http://www.geocities.com/ResearchTriangle/6375
========================================================================
> Could you please tell me if scandir(3) is POSIX.2 ?
Why don't you try the man page? Or perhaps comp.unix.programmer?
--
Attempting to write in a hybrid which can be compiled by either a C compiler
or a C++ compiler produces a compromise language which combines the drawbacks
of both with the advantages of neither.
-- John Winters <jo...@polo.demon.co.uk> in comp.lang.c