delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/01/15/21:02:22

Sender: nate AT cartsys DOT com
Message-ID: <369FF1B8.26B03499@cartsys.com>
Date: Fri, 15 Jan 1999 17:56:08 -0800
From: Nate Eldredge <nate AT cartsys DOT com>
X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.0.36 i586)
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: Travers the DirTree structure in ANSI C++
References: <77gtr6$ng AT bgtnsc02 DOT worldnet DOT att DOT net>
Reply-To: djgpp AT delorie DOT com

Camilo wrote:
> 
> Hi,
> 
>    I need to know how do you travers the DirTree structure in ANSI C++?
> 
> In Win you use:
> 
> struct _finddata_t DirFls;
> _findfirst(char *curpth, &DirFls);
> _findnext( hFile, &DirFls);
> _findclose(hFile);
> 
> as I did in the attached (dirty, yet working) code example.
> 
> I did my homework, and was wondering if ANSI C++ does not provide such
> thing (either).

It doesn't.  But:

* POSIX, generally implemented on DJGPP and Unix systems, has
`opendir'/`readdir'/etc.

* DOS compilers, including DJGPP, have `findfirst'/`findnext'.
-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019