home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / programm / 3933 < prev    next >
Encoding:
Text File  |  1992-07-27  |  891 b   |  25 lines

  1. Newsgroups: comp.unix.programmer
  2. Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!uxa.cso.uiuc.edu!bjg28027
  3. From: bjg28027@uxa.cso.uiuc.edu (Skydive!)
  4. Subject: Better way to count files in dirs
  5. Message-ID: <Bs20zI.EoI@news.cso.uiuc.edu>
  6. Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
  7. Organization: University of Illinois at Urbana
  8. Date: Mon, 27 Jul 1992 15:42:51 GMT
  9. Lines: 14
  10.  
  11. Hello,
  12.  
  13. I'm modifying some code that I've written in C previously and would like to try
  14. to improve on it.  Right now, in order to determine the number of files
  15. in a directory I am doing a system call "ls -1 | wc -l > tmp" and then opening
  16. the file and fscanf the number.  Obviously this is a very ugly way to do
  17. this and I would like to improve it.
  18.  
  19. Are there some functions in <dirents> library that I am missing?
  20.  
  21. Thanks.
  22.  
  23. bgolden@ncsa.uiuc.edu
  24.  
  25.