TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Gautam Lad
from: Jonathan de Boyne Pollard
date: 1996-12-16 14:12:04
subject: DosFindFirst

GL>
  > By any chance is DosFindFirst supposed to return directories upon search?
GL>

  If you ask it to.  It only does what you ask it to do.

GL>
  > So, does anyone have a simple source code that list the
  > full directories in the current path?
GL>

  char WildCard [] = "*" ;
  char FindBuf[8192] ;
  HDIR Dir = HDIR_CREATE ;
  ULONG SearchCount = sizeof(FindBuf) ;
  if (!DosFindFirst (WildCard, &Dir, MUST_HAVE_DIRECTORY|FILE_DIRECTORY,
                     &FindBuf, sizeof(FindBuf),
                     &SearchCount, FIL_STANDARD) ) {
      do {
          FILEFINDBUF3 * fb = (FILEFINDBUF3 *)FindBuf ;
          while (SearchCount--) {
              if (strcmp(fb->achName, ".") &&
strcmp(fb->achName, "..")) {

                     cout achName << endl ;

                  AddConference(fb->cchName, fb->achName) ;
              }
              fb = (FILEFINDBUF3 *)( ((char *)fb) + fb->oNextEntryOffset ) ;
          }

          SearchCount = sizeof(FindBuf) ;
      } while (!DosFindNext(Dir, FindBuf, sizeof(FindBuf), &SearchCount)) ;

      DosFindClose (Dir) ;
  }

  > JdeBP <
___
 X MegaMail 2.10 #0:

--- Maximus/2 3.01
* Origin: DoNoR/2,Woking UK (44-1483-725167) (2:440/4)
SEEN-BY: 270/101 620/243 625/160 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 624 628 713/317 800/1
@PATH: 440/4 141/209 270/101 712/515 711/808 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.