Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stat documentation correction #7196

Closed
p5pRT opened this issue Mar 24, 2004 · 8 comments
Closed

stat documentation correction #7196

p5pRT opened this issue Mar 24, 2004 · 8 comments

Comments

@p5pRT
Copy link

p5pRT commented Mar 24, 2004

Migrated from rt.perl.org#27906 (status was 'resolved')

Searchable as RT27906$

@p5pRT
Copy link
Author

p5pRT commented Mar 24, 2004

From limbic_region_2000@yahoo.com

This is a bug report for perl from
Limbic_Region_2000@​Yahoo.com,
generated with the help of perlbug 1.34 running under
perl v5.8.2.

The documentation for stat reads​:

# The operators -f, -d, -l, -b, -c, -p, and -s.

That should be -S and not -s as -s is for size
I believe it also affects 5.8.3


Flags​:
  category=docs
  severity=low


Site configuration information for perl v5.8.2​:

Configured by Gerrit at Fri Nov 7 12​:03​:56 2003.

Summary of my perl5 (revision 5.0 version 8 subversion
2) configuration​:
  Platform​:
  osname=cygwin, osvers=1.5.5(0.9432),
archname=cygwin-thread-multi-64int
  uname='cygwin_nt-5.0 troubardix 1.5.5(0.9432)
2003-09-20 16​:31 i686 unknown unknown cygwin '
  config_args='-de -Dmksymlinks -Duse64bitint
-Dusethreads -Doptimize=-O2 -Dman3ext=3pm'
  hint=recommended, useposix=true,
d_sigaction=define
  usethreads=define use5005threads=undef
useithreads=define usemultiplicity=define
  useperlio=define d_sfio=undef uselargefiles=define
usesocks=undef
  use64bitint=define use64bitall=undef
uselongdouble=undef
  usemymalloc=y, bincompat5005=undef
  Compiler​:
  cc='gcc', ccflags ='-DPERL_USE_SAFE_PUTENV
-fno-strict-aliasing',
  optimize='-O2',
  cppflags='-DPERL_USE_SAFE_PUTENV
-fno-strict-aliasing'
  ccversion='', gccversion='3.3.1 (cygming
special)', gccosandvers=''
  intsize=4, longsize=4, ptrsize=4, doublesize=8,
byteorder=12345678
  d_longlong=define, longlongsize=8,
d_longdbl=define, longdblsize=12
  ivtype='long long', ivsize=8, nvtype='double',
nvsize=8, Off_t='off_t', lseeksize=8
  alignbytes=8, prototype=define
  Linker and Libraries​:
  ld='ld2', ldflags =' -s -L/usr/local/lib'
  libpth=/usr/local/lib /usr/lib /lib
  libs=-lgdbm -ldb -lcrypt -lgdbm_compat
  perllibs=-lcrypt -lgdbm_compat
  libc=/usr/lib/libc.a, so=dll, useshrplib=true,
libperl=libperl.a
  gnulibc_version=''
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef,
ccdlflags=' -s'
  cccdlflags=' ', lddlflags=' -s -L/usr/local/lib'

Locally applied patches​:


@​INC for perl v5.8.2​:
  /usr/lib/perl5/5.8.2/cygwin-thread-multi-64int
  /usr/lib/perl5/5.8.2
 
/usr/lib/perl5/site_perl/5.8.2/cygwin-thread-multi-64int
  /usr/lib/perl5/site_perl/5.8.2
  /usr/lib/perl5/site_perl
  .


Environment for perl v5.8.2​:
  HOME=/cygdrive/c/Documents and
Settings/joshua.gatcomb
  LANG (unset)
  LANGUAGE (unset)
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
 
PATH=/usr/local/bin​:/usr/bin​:/bin​:/usr/X11R6/bin​:/cygdrive/c/WINDOWS/system32​:/cygdrive/c/WINDOWS​:/cygdrive/c/WINDOWS/System32/Wbem​:/cygdrive/c/Perl/.cpan/build/parrot
  PERL_BADLANG (unset)
  SHELL (unset)

__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http​://taxes.yahoo.com/filing.html

@p5pRT
Copy link
Author

p5pRT commented Mar 25, 2004

From @petdance

The documentation for stat reads​:

# The operators -f, -d, -l, -b, -c, -p, and -s.

That should be -S and not -s as -s is for size
I believe it also affects 5.8.3

Patch attached. Fixes that, and some minor other little construction
stuff.

xoa

Inline Patch
diff -urN -x '*~' bleadperl/pod/perlfunc.pod bleadpatch/pod/perlfunc.pod
--- bleadperl/pod/perlfunc.pod	2004-03-24 15:34:37.000000000 -0600
+++ bleadpatch/pod/perlfunc.pod	2004-03-24 21:33:54.000000000 -0600
@@ -5352,7 +5352,7 @@
            = 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 @@
 
 (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<perlport/"Files and Filesystems">
 for details.
 
-If stat is passed the special filehandle consisting of an underline, no
+If C<stat> 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<stat> or filetest are returned.  Example:
 
     if (-x $file && (($d) = stat(_)) && $d < 0) {
 	print "$file is executable NFS file\n";
@@ -5421,7 +5421,7 @@
     $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<S_IF*> constants are
 
     # Permissions: read, write, execute, for user, group, others.
 
@@ -5442,7 +5442,7 @@
 
     S_IREAD S_IWRITE S_IEXEC
 
-and the S_IF* functions are
+and the C<S_IF*> functions are
 
     S_IMODE($mode)	the part of $mode containing the permission bits
 			and the setuid/setgid/sticky bits
@@ -5451,7 +5451,7 @@
 			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 @@
     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<S_*> constants.  To get status info for a symbolic link
 instead of the target file behind the link, use the C<lstat> function.
 
 =item study SCALAR
diff -urN -x '*~' bleadperl/t/op/stat.t bleadpatch/t/op/stat.t
--- bleadperl/t/op/stat.t	2003-09-23 19:36:15.000000000 -0500
+++ bleadpatch/t/op/stat.t	2004-03-24 21:42:12.000000000 -0600
@@ -26,6 +26,7 @@
 $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 @@
             !isnt($mtime, $ctime, 'hard link ctime != mtime') ) {
             print STDERR <<DIAG;
 # Check if you are on a tmpfs of some sort.  Building in /tmp sometimes
-# has this problem.  Also building on the ClearCase VOBS filesystem may
+# has this problem.  Building on the ClearCase VOBS filesystem may also
 # cause this failure.
-# Darwins UFS doesn't have a ctime concept, and thus is
-# expected to fail this test.
+#
+# Darwin's UFS doesn't have a ctime concept, and thus is expected to fail
+# this test.
 DIAG
         }
     }
@@ -176,7 +178,7 @@
 ok(-w $tmpfile,     '   -w');
 
 SKIP: {
-    skip "-x simply determins if a file ends in an executable suffix", 1
+    skip "-x simply determines if a file ends in an executable suffix", 1
       if $Is_Dosish || $Is_MacOS;
 
     ok(-x $tmpfile,     '   -x');
@@ -212,7 +214,7 @@
       if $Is_MSWin32 || $Is_NetWare || $Is_Dos;
     skip "/dev isn't available to test against", 6
       unless -d '/dev' && -r '/dev' && -x '/dev';
-    skip "Skipping; unexpected ls output in MP-RAS", 6
+    skip "Skipping: unexpected ls output in MP-RAS", 6
       if $Is_MPRAS;
 
     my $LS  = $Config{d_readlink} ? "ls -lL" : "ls -l";
@@ -307,7 +309,7 @@
 SKIP: {
     skip "These tests require a TTY", 4 if $ENV{PERL_SKIP_TTY_TEST};
 
-    my $TTY = $^O eq 'rhapsody' ? "/dev/ttyp0" : "/dev/tty";
+    my $TTY = $Is_Rhapsody ? "/dev/ttyp0" : "/dev/tty";
 
     SKIP: {
         skip "Test uses unixisms", 2 if $Is_MSWin32 || $Is_NetWare;

-- 

Andy Lester => andy@​petdance.com => www.petdance.com => AIM​:petdance

@p5pRT
Copy link
Author

p5pRT commented Mar 25, 2004

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Mar 25, 2004

From spidb@cpan.org

This change is wrong​:

-last stat or filetest are returned. Example​:
+last C<stat> or filetest are returned. Example​:

The generic notion of "stat" is what was meant, not the specific "C<stat>"
operation -- C<lstat> was included. Since Andy said he already applied
that, perhaps this additional change will clear it up​:

-last C<stat> or filetest are returned. Example​:
+last C<stat>, C<lstat>, or filetest are returned. Example​:

--
Spider Boardman (at home) spider.boardman@​orb.dynalias.net
The management (my cats) made me say this. http​://users.rcn.com/spiderb/
PGP public key fingerprint​: 96 72 D2 C6 E0 92 32 89 F6 B2 C2 A0 1C AB 1F DC

@p5pRT
Copy link
Author

p5pRT commented Mar 25, 2004

From @petdance

The generic notion of "stat" is what was meant, not the specific "C<stat>"
operation -- C<lstat> was included. Since Andy said he already applied
that, perhaps this additional change will clear it up​:

I don't have patch rights, so I didn't apply anything. I just submitted
a patch.

--
Andy Lester => andy@​petdance.com => www.petdance.com => AIM​:petdance

@p5pRT
Copy link
Author

p5pRT commented Mar 26, 2004

From perl5-porters@perl.org

On Thu, 25 Mar 2004 11​:21​:39 -0600, Andy Lester wrote (in part)​:

[replying to me​:]

al> I don't have patch rights, so I didn't apply anything. I just submitted
al> a patch.

OK, I was reading too fast and only *thought* that Andy had said anything
about applying his patch. Mea culpa. Whoever gets to looking at this
(Rafael?), please note that my emendation is the only gripe I had with
Andy's patch. Otherwise, I thought it was a good idea.

  --s.

--
Spider Boardman (at home) spider@​Orb.Nashua.NH.US
The management (my cats) made me say this. http​://users.rcn.com/spiderb/
PGP public key fingerprint​: 96 72 D2 C6 E0 92 32 89 F6 B2 C2 A0 1C AB 1F DC

http​://www.xray.mpe.mpg.de/cgi-bin/extract-mbox/perl5-porters/2004-03?20040325034830%2EGA5865%40petdance%2Ecom

@p5pRT
Copy link
Author

p5pRT commented Mar 26, 2004

From ams@wiw.org

At 2004-03-24 21​:48​:30 -0600, andy@​petdance.com wrote​:

diff -urN -x '*~' bleadperl/pod/perlfunc.pod bleadpatch/pod/perlfunc.pod
--- bleadperl/pod/perlfunc.pod 2004-03-24 15​:34​:37.000000000 -0600
+++ bleadpatch/pod/perlfunc.pod 2004-03-24 21​:33​:54.000000000 -0600

Thanks, applied with Spider's correction. (#22593)

-- ams

@p5pRT p5pRT closed this as completed Mar 29, 2004
@p5pRT
Copy link
Author

p5pRT commented Mar 29, 2004

@iabyn - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant