home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / perl / 5007 < prev    next >
Encoding:
Internet Message Format  |  1992-07-28  |  1.2 KB

  1. Path: sparky!uunet!darwin.sura.net!wupost!sdd.hp.com!hplabs!ucbvax!van-bc!sqwest!mch
  2. From: mch@sqwest.wimsey.bc.ca (Mark C. Henderson)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: stat.pl query
  5. Keywords: PERL
  6. Message-ID: <1992Jul28.222152.19409@sqwest.wimsey.bc.ca>
  7. Date: 28 Jul 92 22:21:52 GMT
  8. References: <1992Jul28.171317.22804@rdg.dec.com>
  9. Organization: SoftQuad Inc., Surrey, B.C. CANADA
  10. Lines: 31
  11.  
  12. In article <1992Jul28.171317.22804@rdg.dec.com> stuart@ds3100.new.dec.com (Stuart Broderick) writes:
  13. >Probably a stupid question, but....
  14. >
  15. >The following script is using stat.pl to determine the mode of a file
  16. >using stat.pl. 
  17. >
  18. >#! /usr/local/bin/perl
  19. >require 'stat.pl';
  20. >do Stat('./test');
  21. >print $st_mode,"\t",$st_uid,"\t",$st_gid,"\n";
  22. >
  23. >When this runs, I get 
  24. >
  25. >st_mode st_uid  st_gid
  26. >33224   1103    100
  27. >
  28. >I expected it to give 0710. 
  29. >
  30. >Can anyone tell me what I've done wrong ? I'm looking for a numeric
  31. >representation of 
  32. >the permissions field.
  33. >
  34. >Stuart.
  35.  
  36. 33224 (decimal) = 100710 (octal)
  37.  
  38. Mark
  39. -- 
  40. Mark Henderson, SoftQuad Inc, 108-10070 King George Hwy, Surrey, B.C. V3T 2W4
  41. Internet:   mch@west.sq.com, mch@sqwest.wimsey.bc.ca
  42. UUCP: {van-bc,sq}!sqwest!mch Telephone: +1 604 585 8394  Fax: +1 604 585 1926
  43.