Re: findfirst, findnext and finddata_t



On Wed, 16 Jan 2008 07:57:59 -0500 Linonut <linonut@xxxxxxxxxxxxx> wrote:
| * Michel peremptorily fired off this memo:
|
|> Hey folks,
|>
|> I'm porting a Win32 application to linux. I'm looking for the
|> equivalent functions to _findfirst, _findnext and definitions
|> finddata_t on linux.
|> I do care about portability, so I don't think it's a good idea to use
|> the linux inherent opendir, readir, etc. to do the job instead.
|> The best thing would be to have a _findfirst, _findnext, _finddata_t
|> implementation for linux. Is there some library that already
|> implements them?
|
| "man ftw"

The Win32 API appears, based on the little bit posted in this thread, to
have distinct functions to get the first (probably also initiating the
tree walk) and each subsequent item. The ftw "package" does not appear
to be like that at all. Perhaps the Win32 functions have some kind of
pointer to an instance that allows the findnext function (which ftw has
no equivalent for) to work. If that is so, then it would be possible to
do two or more separate tree walks across different trees at in parallel
at the same time. The ftw function cannot do that due to the way it is
designed as a callback function.

So I suggest that ftw is not a good equivalent. I have argued in the
past that ftw should even be depricated and eventually removed. There
are better APIs available, including fts that is already included, even
though it is rather difficult to use due to so many options, as well as
my own ftr functions. You can browse the source code of these functions
directly at: http://libh.slashusr.org/source/ftr/src/lib/h/
Do be sure to look at the ftr_header.h file since a number of macros
that would be used like functions are defined there.

--
-----------------------------------------------------------------------------
| Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
| (first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------
.



Relevant Pages

  • Re: Linux / Windows GUI application with assembly
    ... before Applications could have been written in Asm, ... under Win32, and the Linux Asm Stuff is still in the ... There is still some assemblers which compile successfully binaries ... under Linux, and I thought someone had already investigated the GUI ...
    (alt.lang.asm)
  • Re: The Delphi Survey
    ... and Linux, but not for win32 and .NET. ... capacity and bigger gain for code compatibility with Linux than there is ... It's also different because .NET, without Mono support, is a Windows ...
    (borland.public.delphi.non-technical)
  • Re: Will there ever be a new Delphi for Win32?
    ... some .NET projects run on Mono directly. ... Calvert's article on running .NET WinForms code on Mono and Linux. ... No. CLX is only supported on Win32 and Linux. ... Yorai Aminov (TeamB) ...
    (borland.public.delphi.non-technical)
  • Re: Interactive sessions on another box from Win32
    ... I planned to ssh to the ... > Expect is not an option on Win32. ... > for connecting securely to linux box and running interactive programs on the ... This is a command line login, or a GUI login? ...
    (comp.lang.perl.misc)