TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Gautam Lad
from: Bill Christensen
date: 1996-12-14 14:43:00
subject: DosFindFirst

GL> By any chance is DosFindFirst supposed to return directories upon
GL> search? I don't think so, based on my experience with it (I tried 
GL> everything, I think). So, does anyone have a simple source code that
GL> list the  full directories in the current path?  I can modify this
GL> to  do a global find (all dirs. and sub-dirs.). 

The DosFindFirst function is used to setup the search.  DosFindNext is
then used to return each subdir entry, to your program.  So you use the
DosFindFirst once, and then keep using  DosFindNext until it returns
error 18 (ERROR_NO_MORE_FILES).  example:

rc= DosFindFirst ("*.*",&findhandle,FILE_DIRECTORY,(PVOID)
&Findbuffer,sizeof (Findbuffer,&Findcound,FIL_STANDARD)

while (rc=0) //finds all the subdirectory entries in the current
directory.  { rc=DosFindNext(findhandle,
(PVOID)&Findbuffer,sizeof(findbuffer),1); //now you need code to
transfer the data,which is a string showing a full path subdirectory
entry,  from findbuffer to another memory location because the next
call to DosFindNext is going to overwrite the findbuffer with a new
subdirectory name. }
Use the subdirectiory entries returned by DosFindNext to change the
current directory and then find more subdirectorys in that current
directory, and so on.  TTFN Bill  Internet address wchriste{at}eagle.wbm.ca

___
 X KWQ/2 1.2i X Explosion at sperm bank.  Nurses overcome. 

--- Maximus/2 2.02
* Origin: OS/2 Shareware BBS, telnet://bbs.os2bbs.com (1:109/347)
SEEN-BY: 50/99 270/101 620/243 625/160 711/401 409 410 413 430 808 809 934
SEEN-BY: 711/955 712/407 515 624 628 713/317 800/1
@PATH: 109/347 18 7 396/1 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™.