home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / perl / 5001 < prev    next >
Encoding:
Text File  |  1992-07-28  |  1.1 KB  |  41 lines

  1. Path: sparky!uunet!pmafire!news.dell.com!swrinde!mips!mips!decwrl!deccrl!news.crl.dec.com!rdg.dec.com!ds3100.new.dec.com!stuart
  2. From: stuart@ds3100.new.dec.com (Stuart Broderick)
  3. Newsgroups: comp.lang.perl
  4. Subject: stat.pl query
  5. Keywords: PERL
  6. Message-ID: <1992Jul28.171317.22804@rdg.dec.com>
  7. Date: 28 Jul 92 17:13:17 GMT
  8. Sender: news@rdg.dec.com (Mr News)
  9. Reply-To: stuart@ds3100.new.dec.com (Stuart Broderick)
  10. Organization: Digital Equipment Corporation
  11. Lines: 28
  12.  
  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. When I do a "ls -lag ./test",  I get
  29.  
  30. -rwx--x---  1 stuart   espo       286720 Jul 28 17:56 ./test
  31.  
  32. The username and group are correct (st_uid, st_gid), but what does
  33. st_mode relate to ? 
  34. I expected it to give 0710. 
  35.  
  36. Can anyone tell me what I've done wrong ? I'm looking for a numeric
  37. representation of 
  38. the permissions field.
  39.  
  40. Stuart.
  41.