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

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!lwvanels
  3. From: lwvanels@athena.mit.edu (Lucien W. Van Elsen)
  4. Subject: Re: stat.pl query
  5. In-Reply-To: stuart@ds3100.new.dec.com's message of Tue, 28 Jul 1992 17:13:17 GMT
  6. Message-ID: <LWVANELS.92Jul28145102@fionavar.mit.edu>
  7. Sender: news@athena.mit.edu (News system)
  8. Nntp-Posting-Host: fionavar.mit.edu
  9. Reply-To: lwvanels@MIT.EDU
  10. Organization: Massachusetts Institute of Technology
  11. References: <1992Jul28.171317.22804@rdg.dec.com>
  12. Date: Tue, 28 Jul 1992 18:51:10 GMT
  13. Lines: 21
  14.  
  15. stuart@ds3100.new.dec.com (Stuart Broderick) writes:
  16. >   When this runs, I get 
  17. >
  18. >   st_mode st_uid  st_gid
  19. >   33224   1103    100
  20. >
  21. >   When I do a "ls -lag ./test",  I get
  22. >
  23. >   -rwx--x---  1 stuart   espo       286720 Jul 28 17:56 ./test
  24. >
  25. >   The username and group are correct (st_uid, st_gid), but what does
  26. >   st_mode relate to ? 
  27. >   I expected it to give 0710. 
  28.  
  29. A couple things should clear this up- First, the st_mode field gives more
  30. than just the file protection; it also contains the type of the file.
  31. Additionally, st_mode is returned in decimal.  33224 is 0100710 in octal;
  32. according to /usr/include/sys/stat.h under Ultrix, _S_IFREG is 0100000.  So,
  33. the file you stat'd is a regular file with the protections you expected.
  34.  
  35.     -Lucien
  36.