home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / c / 18885 < prev    next >
Encoding:
Internet Message Format  |  1992-12-25  |  1.1 KB

  1. Path: sparky!uunet!spool.mu.edu!wupost!usc!srhqla!quest!kdq
  2. From: kdq@quest.UUCP (Kevin D. Quitt)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Find files of a directory in UNIX
  5. Message-ID: <s7iBwB6w165w@quest.UUCP>
  6. Date: Thu, 24 Dec 92 19:21:39 PST
  7. References: <1992Dec23.073911.915@dec8.ncku.edu.tw>
  8. Reply-To: srhqla!quest!kdq
  9. Organization: Job quest  (805) 251-8210,  So Cal: (800) 400-8210
  10. Lines: 27
  11.  
  12. wangbs @casd1.iie.ncku writes:
  13.  
  14. >    Hi, all :
  15. >        In UNIX, how can I program to find all files in a directory ?  Since
  16. >    I am not familar in C, It is better having example...
  17.  
  18.     try ls
  19.  
  20.  
  21. >         Thanks for any response & happy new year !!!!
  22.  
  23.     you're welcome.
  24.  
  25.  
  26. (P.S., from the FAQ:)
  27.  
  28. 12.15:    How can I read a directory in a C program?
  29.  
  30. A:    See if you can use the opendir() and readdir() routines, which
  31.     are available on most Unix systems.  Implementations also exist
  32.     for MS-DOS, VMS, and other systems.  (MS-DOS also has FINDFIRST
  33.     and FINDNEXT routines which do essentially the same thing.)
  34.  
  35.  
  36.  _
  37. Kevin D. Quitt      96.37% of all statistics are made up.     srhqla!quest!kdq
  38.