home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / shell / 3526 < prev    next >
Encoding:
Text File  |  1992-08-19  |  2.5 KB  |  58 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!ukma!wupost!cs.utexas.edu!convex!convex!tchrist
  3. From: Tom Christiansen <tchrist@convex.COM>
  4. Subject: Re: Octal chmod status
  5. Originator: tchrist@pixel.convex.com
  6. Sender: usenet@news.eng.convex.com (news access account)
  7. Message-ID: <1992Aug19.143059.17010@news.eng.convex.com>
  8. Date: Wed, 19 Aug 1992 14:30:59 GMT
  9. Reply-To: tchrist@convex.COM (Tom Christiansen)
  10. References: <Bt7t36.1w3@mudos.ann-arbor.mi.us> <1992Aug19.130558.8488@news.eng.convex.com> <1r!n6yd.messina@netcom.com>
  11. Nntp-Posting-Host: pixel.convex.com
  12. Organization: Convex Computer Corporation, Colorado Springs, CO
  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: 40
  17.  
  18. From the keyboard of messina@netcom.com (Tony Porczyk):
  19. :Tom Christiansen <tchrist@convex.COM> responds to Marc Unangst:
  20. :
  21. :>Big deal.  That infinitesimal time difference is surely not
  22. :>worth all the hassle of writing a C program for each and every little
  23. :
  24. :Even though I agree that the perl solution was fine (by being so
  25. :small), but I do not understand the bruhaha about the "hassle" of
  26. :writing a C program for small tasks.  It is often much simpler and
  27. :*faster* to write the C code than to implement other solutions.  At
  28. :least it is much more *readable* than the aformentioned perl script... 
  29.  
  30. Fine, if you want me to optimize for legibility, I'll do that.
  31.  
  32.     require 'stat.pl';
  33.     @sb = stat($ARGV[0]);
  34.     printf("%04o\n", $sb[$ST_MODE]);
  35.  
  36. The bruhaha stems from having to install a hundred binaries on a hundred
  37. systems spanning a dozen different architectures.  Programs that aren't
  38. self-contained are a major hassle.  
  39.  
  40. For this reason, I'd much rather see an embedded here-is document used
  41. than an auxiliary data file, and I'd much rather see a solution calling
  42. sed, awk, or perl than one requiring dedicated C programs.  
  43.  
  44. In many cases (of which this is a prime example) by the time you've
  45. written your C program, I'll be long done with the perl version, and will
  46. have probably finished a couple other programs as well.
  47.  
  48. Putting your interpreted programs in a commonly-mounted directory is a
  49. major win in convenience as well as in disk space.
  50.  
  51. --tom
  52.  
  53. -- 
  54.     Tom Christiansen      tchrist@convex.com      convex!tchrist
  55. "I sincerely hope that the future does not mean we must continually restrict
  56.  ourselves to the tools that were available 10 years ago."
  57.     Mark Bush in comp.unix.wizards <4235@inca.comlab.ox.ac.uk>
  58.