home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / c / 19124 < prev    next >
Encoding:
Text File  |  1993-01-01  |  1.6 KB  |  49 lines

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!rutgers!flop.ENGR.ORST.EDU!leela.CS.ORST.EDU!atlantis.CS.ORST.EDU!omarab
  2. From: omarab@atlantis.CS.ORST.EDU (Scorpion)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Directory search function needed
  5. Message-ID: <1i2hiqINNp65@leela.CS.ORST.EDU>
  6. Date: 1 Jan 93 22:45:46 GMT
  7. References: <8829@orbit.cts.com>
  8. Organization: OSU CS Outreach Services, Corvallis, Oregon
  9. Lines: 37
  10. NNTP-Posting-Host: atlantis.cs.orst.edu
  11.  
  12. OK.... I had been interested in such a file search program too.... This
  13. example is found in the THELP program which is supplied with Turbo C:
  14.  
  15. #include "c:\borland\include\dir.h"
  16. #include "c:\borland\include\stdio.h"
  17.  
  18. void main()
  19. {
  20. struct ffblk ffblk;
  21. int done;
  22.  
  23. done = findfirst("*.*", &ffblk, 0);
  24. while(!done)
  25.   {
  26.   printf("%s\n", ffblk.ff_name);
  27.   done = findnext(&ffblk);
  28.   }
  29. }
  30.  
  31. That should do it for ya dude.... the findfirst command is the one you will
  32. use... allong with the findnext command.  Hope that helps ya out....
  33.  
  34. -----------------------------------------------------------------------------
  35.  Brendan O'Mara                    Owner, Stealth Technologies,
  36.  Email: omarab@jacobs.ucs.orst.edu        specializing in:
  37.  Alias: Scorpion                    
  38.  Phone: (503)745-7549                Programming
  39.                         Computer Lessons
  40.  Sysop of the Stealth BBS:            Computer Setup Assistance
  41.  (503)745-7549, 9pm-7am weekdays,            
  42.  24 hours most weekends.            Call for details!
  43. ------------------------------------------------------------------------------
  44. -- 
  45. -----------------------------------------------------------------------------
  46.  Brendan O'Mara                    Owner, Stealth Technologies,
  47.  Email: omarab@jacobs.ucs.orst.edu        specializing in:
  48.  Alias: Scorpion                    
  49.