From: Andy Lester Date: Wed, 24 Mar 2004 21:48:30 +0000 (-0600) Subject: Re: [perl #27906] stat documentation correction X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=61967be2c930c0a1754925d7a1d1c2924a3b57ab;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #27906] stat documentation correction Message-Id: <20040325034830.GA5865@petdance.com> (Applied with a correction from Spider Boardman.) p4raw-id: //depot/perl@22593 --- diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 96dabbb..2c368e9 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -5352,7 +5352,7 @@ as follows: = stat($filename); Not all fields are supported on all filesystem types. Here are the -meaning of the fields: +meanings of the fields: 0 dev device number of filesystem 1 ino inode number @@ -5370,13 +5370,13 @@ meaning of the fields: (The epoch was at 00:00 January 1, 1970 GMT.) -(*) The ctime field is non-portable, in particular you cannot expect +(*) The ctime field is non-portable. In particular, you cannot expect it to be a "creation time", see L for details. -If stat is passed the special filehandle consisting of an underline, no +If C is passed the special filehandle consisting of an underline, no stat is done, but the current contents of the stat structure from the -last stat or filetest are returned. Example: +last C, C, or filetest are returned. Example: if (-x $file && (($d) = stat(_)) && $d < 0) { print "$file is executable NFS file\n"; @@ -5421,7 +5421,7 @@ You can import symbolic mode constants (C) and functions $is_setgid = S_ISDIR($mode); You could write the last two using the C<-u> and C<-d> operators. -The commonly available S_IF* constants are +The commonly available C constants are # Permissions: read, write, execute, for user, group, others. @@ -5442,7 +5442,7 @@ The commonly available S_IF* constants are S_IREAD S_IWRITE S_IEXEC -and the S_IF* functions are +and the C functions are S_IMODE($mode) the part of $mode containing the permission bits and the setuid/setgid/sticky bits @@ -5451,7 +5451,7 @@ and the S_IF* functions are which can be bit-anded with e.g. S_IFREG or with the following functions - # The operators -f, -d, -l, -b, -c, -p, and -s. + # The operators -f, -d, -l, -b, -c, -p, and -S. S_ISREG($mode) S_ISDIR($mode) S_ISLNK($mode) S_ISBLK($mode) S_ISCHR($mode) S_ISFIFO($mode) S_ISSOCK($mode) @@ -5463,7 +5463,7 @@ and the S_IF* functions are S_ISENFMT($mode) S_ISWHT($mode) See your native chmod(2) and stat(2) documentation for more details -about the S_* constants. To get status info for a symbolic link +about the C constants. To get status info for a symbolic link instead of the target file behind the link, use the C function. =item study SCALAR diff --git a/t/op/stat.t b/t/op/stat.t index 3cc3f0a..23445c2 100755 --- a/t/op/stat.t +++ b/t/op/stat.t @@ -26,6 +26,7 @@ $Is_Solaris = $^O eq 'solaris'; $Is_VMS = $^O eq 'VMS'; $Is_DGUX = $^O eq 'dgux'; $Is_MPRAS = $^O =~ /svr4/ && -f '/etc/.relid'; +$Is_Rhapsody= $^O eq 'rhapsody'; $Is_Dosish = $Is_Dos || $Is_OS2 || $Is_MSWin32 || $Is_NetWare || $Is_Cygwin; @@ -112,10 +113,11 @@ SKIP: { !isnt($mtime, $ctime, 'hard link ctime != mtime') ) { print STDERR <