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

  1. Newsgroups: comp.unix.programmer
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!convex!convex!tchrist
  3. From: Tom Christiansen <tchrist@convex.COM>
  4. Subject: Re: Better way to count files in dirs
  5. Message-ID: <1992Jul27.160410.11259@news.eng.convex.com>
  6. Originator: tchrist@pixel.convex.com
  7. Sender: usenet@news.eng.convex.com (news access account)
  8. Nntp-Posting-Host: pixel.convex.com
  9. Reply-To: tchrist@convex.COM (Tom Christiansen)
  10. Organization: CONVEX Realtime Development, Colorado Springs, CO
  11. References: <Bs20zI.EoI@news.cso.uiuc.edu>
  12. Date: Mon, 27 Jul 1992 16:04:10 GMT
  13. X-Disclaimer: This message was written by a user at CONVEX Computer
  14.               Corp. The opinions expressed are those of the user and
  15.               not necessarily those of CONVEX.
  16. Lines: 19
  17.  
  18. From the keyboard of bjg28027@uxa.cso.uiuc.edu (Skydive!):
  19. :Hello,
  20. :
  21. :I'm modifying some code that I've written in C previously and would like to try
  22. :to improve on it.  Right now, in order to determine the number of files
  23. :in a directory I am doing a system call "ls -1 | wc -l > tmp" and then opening
  24. :the file and fscanf the number.  Obviously this is a very ugly way to do
  25. :this and I would like to improve it.
  26. :
  27. :Are there some functions in <dirents> library that I am missing?
  28.  
  29. RTFM readdir, opendir, etc.
  30.  
  31. --tom
  32. -- 
  33.     Tom Christiansen      tchrist@convex.com      convex!tchrist
  34.     If you have ever seen the grim word "login:" on a screen, your mind
  35.     is now a wholly-owned subsidiary of The Death Star.
  36.                 John Woods in <14105@ksr.com> of comp.unix.bsd
  37.