Skip Menu |
Report information
Id: 121523
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: smylers [at] stripey.com
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: low
Type:
  • unknown
  • Patch
Perl Version: (no value)
Fixed In: (no value)

Attachments
0001-Document-l-on-symlinkless-file-systems.patch



Date: Fri, 28 Mar 2014 16:37:29 +0000 (GMT)
To: perlbug [...] perl.org
CC: Smylers [...] stripey.com
Subject: [PATCH] Document -l on symlinkless file systems
From: Smylers [...] stripey.com
Download (untitled) / with headers
text/plain 3.1k
This is a bug report for perl from Smylers@stripey.com, generated with the help of perlbug 1.40 running under perl 5.19.11. ----------------------------------------------------------------- Documenting Zefram's reply to Dave M's question about -l: http://www.nntp.perl.org/group/perl.perl5.porters/2014/03/msg214012.html ----------------------------------------------------------------- --- Flags: category=docs severity=low Type=Patch PatchStatus=HasPatch --- Site configuration information for perl 5.19.11: Configured by smylers at Fri Mar 28 15:10:22 GMT 2014. Summary of my perl5 (revision 5 version 19 subversion 11) configuration: Derived from: 721b26746b834f5757da998a7d1918547cf27ef3 Platform: osname=linux, osvers=3.11.0-19-generic, archname=x86_64-linux uname='linux fozzie 3.11.0-19-generic #33-ubuntu smp tue mar 11 18:48:34 utc 2014 x86_64 x86_64 x86_64 gnulinux ' config_args='-des -Dusedevel' hint=previous, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' ccversion='', gccversion='4.8.1', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc', ldflags =' -fstack-protector -L/usr/local/lib' libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed /usr/include/x86_64-linux-gnu /usr/lib libs=-lnsl -ldl -lm -lcrypt -lutil -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc libc=libc-2.17.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.17' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector' Locally applied patches: uncommitted-changes --- @INC for perl 5.19.11: lib /usr/local/lib/perl5/site_perl/5.19.11/x86_64-linux /usr/local/lib/perl5/site_perl/5.19.11 /usr/local/lib/perl5/5.19.11/x86_64-linux /usr/local/lib/perl5/5.19.11 . --- Environment for perl 5.19.11: HOME=/home/smylers LANG=en_GB.utf8 LANGUAGE=en_GB:en LC_COLLATE=C LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/home/smylers/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/games PERL_BADLANG (unset) PERL_CPANM_OPT=--sudo --prompt SHELL=/bin/bash

Message body is not shown because sender requested not to inline it.

Date: Sat, 29 Mar 2014 19:26:30 +0000
To: perl5-porters [...] perl.org
Subject: Re: [perl #121523] [PATCH] Document -l on symlinkless file systems
From: Dave Mitchell <davem [...] iabyn.com>
Download (untitled) / with headers
text/plain 392b
On Fri, Mar 28, 2014 at 09:37:49AM -0700, Smylers wrote: Show quoted text
> Documenting Zefram's reply to Dave M's question about -l: > http://www.nntp.perl.org/group/perl.perl5.porters/2014/03/msg214012.html
I don't understand why a new ticket was needed for this; my follow-up reply has been attached to ticket #72028, and I'll close this one shortly. -- I thought I was wrong once, but I was mistaken.
To: perl5-porters [...] perl.org
Date: Sat, 29 Mar 2014 22:14:29 +0000
Subject: Re: [perl #121523] [PATCH] Document -l on symlinkless file systems
From: Smylers <Smylers [...] stripey.com>
Download (untitled) / with headers
text/plain 884b
Dave Mitchell writes: Show quoted text
> On Fri, Mar 28, 2014 at 09:37:49AM -0700, Smylers wrote: >
> > Documenting Zefram's reply to Dave M's question about -l: > > http://www.nntp.perl.org/group/perl.perl5.porters/2014/03/msg214012.html
> > I don't understand why a new ticket was needed for this; my follow-up > reply has been attached to ticket #72028
Apologies if I've misunderstood, but it looked to me like #72028 is about fixing a problem with installing some utility programs. This ticket is about improving the user documentation of the -l function. The gap in the current -l documentation appeared to be identified by your asking about it in the process of working on #72028, but I think the two tickets are independent matters: this doc patch could be applied regardless of the fix for #72028 (or vice versa). Hope that makes sense. Cheers Smylers -- http://twitter.com/Smylers2
From: Karl Williamson <public [...] khwilliamson.com>
Subject: Re: [perl #121523] [PATCH] Document -l on symlinkless file systems
Date: Sat, 29 Mar 2014 21:32:51 -0600
To: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1019b
On 03/29/2014 04:14 PM, Smylers wrote: Show quoted text
> Dave Mitchell writes: >
>> On Fri, Mar 28, 2014 at 09:37:49AM -0700, Smylers wrote: >>
>>> Documenting Zefram's reply to Dave M's question about -l: >>> http://www.nntp.perl.org/group/perl.perl5.porters/2014/03/msg214012.html
>> >> I don't understand why a new ticket was needed for this; my follow-up >> reply has been attached to ticket #72028
> > Apologies if I've misunderstood, but it looked to me like #72028 is > about fixing a problem with installing some utility programs. This > ticket is about improving the user documentation of the -l function. > > The gap in the current -l documentation appeared to be identified by > your asking about it in the process of working on #72028, but I think > the two tickets are independent matters: this doc patch could be applied > regardless of the fix for #72028 (or vice versa). > > Hope that makes sense. > > Cheers > > Smylers >
The doc patch seems to me to be a worthwhile addition. Are there objections to applying it?
From: Eric Brine <ikegami [...] adaelis.com>
CC: perl5 porters <perl5-porters [...] perl.org>
Subject: Re: [perl #121523] [PATCH] Document -l on symlinkless file systems
Date: Sun, 30 Mar 2014 14:07:35 -0400
To: Karl Williamson <public [...] khwilliamson.com>
Download (untitled) / with headers
text/plain 1.5k
It seems self-evident to me that a file can't be symlink on a system without symlinks. I see no value to the patch, but I see no harm either.

I was about to comment "defined false" would be better than false, but it's implied earlier on in the documentation that false is different than undef.

(It claims that an empty string is returned for false, which is inaccurate. It claims that a returned undef signals that the file doesn't exist, which is inaccurate.)



On Sat, Mar 29, 2014 at 11:32 PM, Karl Williamson <public@khwilliamson.com> wrote:
Show quoted text
On 03/29/2014 04:14 PM, Smylers wrote:
Dave Mitchell writes:

On Fri, Mar 28, 2014 at 09:37:49AM -0700, Smylers wrote:

Documenting Zefram's reply to Dave M's question about -l:
http://www.nntp.perl.org/ group/perl.perl5.porters/2014/ 03/msg214012.html

I don't understand why a new ticket was needed for this; my follow-up
reply has been attached to ticket #72028

Apologies if I've misunderstood, but it looked to me like #72028 is
about fixing a problem with installing some utility programs. This
ticket is about improving the user documentation of the -l function.

The gap in the current -l documentation appeared to be identified by
your asking about it in the process of working on #72028, but I think
the two tickets are independent matters: this doc patch could be applied
regardless of the fix for #72028 (or vice versa).

Hope that makes sense.

Cheers

Smylers


The doc patch seems to me to be a worthwhile addition.  Are there objections to applying it?

Date: Sun, 30 Mar 2014 19:19:53 +0100
To: Eric Brine via RT <perlbug-followup [...] perl.org>
Subject: Re: [perl #121523] [PATCH] Document -l on symlinkless file systems
From: Smylers <smylers [...] stripey.com>
Download (untitled) / with headers
text/plain 539b
Eric Brine via RT writes: Show quoted text
> It seems self-evident to me that a file can't be symlink on a system > without symlinks.
The fact that Dave M posed the question suggests there are at least some to whom it isn't evident. Show quoted text
> (It claims that an empty string is returned for false, which is > inaccurate. It claims that a returned undef signals that the file > doesn't exist, which is inaccurate.)
What would be accurate to say instead? We may as well fix that part of the docs now you've spotted it. Smylers -- http://twitter.com/Smylers2
Date: Wed, 2 Apr 2014 12:19:50 +0100
To: Smylers <smylers [...] stripey.com>
Subject: Re: [perl #121523] [PATCH] Document -l on symlinkless file systems
CC: Eric Brine via RT <perlbug-followup [...] perl.org>
From: Dave Mitchell <davem [...] iabyn.com>
Download (untitled) / with headers
text/plain 654b
On Sun, Mar 30, 2014 at 07:19:53PM +0100, Smylers wrote: Show quoted text
> Eric Brine via RT writes: >
> > It seems self-evident to me that a file can't be symlink on a system > > without symlinks.
> > The fact that Dave M posed the question suggests there are at least some > to whom it isn't evident.
For example it occurred to me that on platforms that don't support symlinks, -l might well croak rather than return false. Even if it currently returned false, unless that behaviour was documented, it would be behaviour I shouldn't be relying upon. -- Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
From: Eric Brine <ikegami [...] adaelis.com>
Subject: Re: [perl #121523] [PATCH] Document -l on symlinkless file systems
CC: Smylers <smylers [...] stripey.com>, Eric Brine via RT <perlbug-followup [...] perl.org>
To: Dave Mitchell <davem [...] iabyn.com>
Date: Wed, 2 Apr 2014 10:53:47 -0400
Download (untitled) / with headers
text/plain 570b
On Wed, Apr 2, 2014 at 7:19 AM, Dave Mitchell <davem@iabyn.com> wrote:
Show quoted text
For example it occurred to me that on platforms that don't support
symlinks, -l might well croak rather than return false. Even if it
currently returned false, unless that behaviour was documented, it would
be behaviour I shouldn't be relying upon.

The behaviour is documented: It's documented to return false if it's not a symlink. Croaking would be a deviation, and it should be documented in perlport.

Out of curiosity, what platform supported by Perl doesn't support symlinks? VMS?

Subject: Re: [perl #121523] [PATCH] Document -l on symlinkless file systems
CC: Dave Mitchell <davem [...] iabyn.com>, Smylers <smylers [...] stripey.com>, Eric Brine via RT <perlbug-followup [...] perl.org>
Date: Wed, 2 Apr 2014 10:15:22 -0500
To: Eric Brine <ikegami [...] adaelis.com>
From: "Craig A. Berry" <craig.a.berry [...] gmail.com>
Download (untitled) / with headers
text/plain 584b
On Wed, Apr 2, 2014 at 9:53 AM, Eric Brine <ikegami@adaelis.com> wrote: Show quoted text
> Out of curiosity, what platform supported by Perl doesn't support symlinks? > VMS?
VMS 8.3 (released in 2006) and later support symlinks. You have to have the right volume settings as well as OS version to get symlink support. There are some limitations but it works reasonably well. I think it was Windows where there is a symlink implementation but it's so different from Unixy expectations that it would be a significant effort to write a layer on top of it so it could be useful to Perl applications.
From: Eric Brine <ikegami [...] adaelis.com>
Date: Wed, 2 Apr 2014 12:24:34 -0400
To: "Craig A. Berry" <craig.a.berry [...] gmail.com>
Subject: Re: [perl #121523] [PATCH] Document -l on symlinkless file systems
CC: Dave Mitchell <davem [...] iabyn.com>, Smylers <smylers [...] stripey.com>, Eric Brine via RT <perlbug-followup [...] perl.org>
Download (untitled) / with headers
text/plain 971b
On Wed, Apr 2, 2014 at 11:15 AM, Craig A. Berry <craig.a.berry@gmail.com> wrote:
Show quoted text
On Wed, Apr 2, 2014 at 9:53 AM, Eric Brine <ikegami@adaelis.com> wrote:
> Out of curiosity, what platform supported by Perl doesn't support symlinks?
> VMS?

VMS 8.3 (released in 2006) and later support symlinks.  You have to
have the right volume settings as well as OS version to get symlink
support.  There are some limitations but it works reasonably well.

I think it was Windows where there is a symlink implementation but
it's so different from Unixy expectations that it would be a
significant effort to write a layer on top of it so it could be useful
to Perl applications.

So there's a proposed change to clarify what happens on systems without symlinks, when all systems have symlinks. It's even more useless than I thought. If a clarification is needed, it's that it can return false even for symlinks on Windows. But that belongs in perlport, right?

CC: Dave Mitchell <davem [...] iabyn.com>, Smylers <smylers [...] stripey.com>, Eric Brine via RT <perlbug-followup [...] perl.org>
Subject: Re: [perl #121523] [PATCH] Document -l on symlinkless file systems
Date: Wed, 02 Apr 2014 11:45:59 -0600
To: Eric Brine <ikegami [...] adaelis.com>, "Craig A. Berry" <craig.a.berry [...] gmail.com>
From: Karl Williamson <public [...] khwilliamson.com>
Download (untitled) / with headers
text/plain 1.5k
On 04/02/2014 10:24 AM, Eric Brine wrote: Show quoted text
> On Wed, Apr 2, 2014 at 11:15 AM, Craig A. Berry <craig.a.berry@gmail.com > <mailto:craig.a.berry@gmail.com>> wrote: > > On Wed, Apr 2, 2014 at 9:53 AM, Eric Brine <ikegami@adaelis.com > <mailto:ikegami@adaelis.com>> wrote:
> > Out of curiosity, what platform supported by Perl doesn't support
> symlinks?
> > VMS?
> > VMS 8.3 (released in 2006) and later support symlinks. You have to > have the right volume settings as well as OS version to get symlink > support. There are some limitations but it works reasonably well. > > I think it was Windows where there is a symlink implementation but > it's so different from Unixy expectations that it would be a > significant effort to write a layer on top of it so it could be useful > to Perl applications. > > > So there's a proposed change to clarify what happens on systems without > symlinks, when all systems have symlinks. It's even more useless than I > thought. If a clarification is needed, it's that it can return false > even for symlinks on Windows. But that belongs in perlport, right? >
This claim doesn't sound right to me. It sounds to me like there are platforms, including VMS, which don't have or are not configured to have symlinks that Perl understands. Further, there are subtle differences between return undef; vs return; Thus, a patch that correctly documents the behavior for this circumstance seems to me to be an improvement that will help out people trying to use Perl. I count myself as one of them.
Subject: Re: [perl #121523] [PATCH] Document -l on symlinkless file systems
CC: Eric Brine <ikegami [...] adaelis.com>, Dave Mitchell <davem [...] iabyn.com>, Smylers <smylers [...] stripey.com>, Eric Brine via RT <perlbug-followup [...] perl.org>
Date: Wed, 2 Apr 2014 13:31:09 -0500
To: Karl Williamson <public [...] khwilliamson.com>
From: "Craig A. Berry" <craig.a.berry [...] gmail.com>
Download (untitled) / with headers
text/plain 2.2k
On Wed, Apr 2, 2014 at 12:45 PM, Karl Williamson <public@khwilliamson.com> wrote: Show quoted text
> On 04/02/2014 10:24 AM, Eric Brine wrote:
>> >> On Wed, Apr 2, 2014 at 11:15 AM, Craig A. Berry <craig.a.berry@gmail.com >> <mailto:craig.a.berry@gmail.com>> wrote: >> >> On Wed, Apr 2, 2014 at 9:53 AM, Eric Brine <ikegami@adaelis.com >> <mailto:ikegami@adaelis.com>> wrote:
>> > Out of curiosity, what platform supported by Perl doesn't support
>> symlinks?
>> > VMS?
>> >> VMS 8.3 (released in 2006) and later support symlinks. You have to >> have the right volume settings as well as OS version to get symlink >> support. There are some limitations but it works reasonably well. >> >> I think it was Windows where there is a symlink implementation but >> it's so different from Unixy expectations that it would be a >> significant effort to write a layer on top of it so it could be useful >> to Perl applications. >> >> >> So there's a proposed change to clarify what happens on systems without >> symlinks, when all systems have symlinks. It's even more useless than I >> thought. If a clarification is needed, it's that it can return false >> even for symlinks on Windows. But that belongs in perlport, right? >>
> > This claim doesn't sound right to me.
Me either. Show quoted text
> It sounds to me like there are > platforms, including VMS, which don't have or are not configured to have > symlinks that Perl understands.
VMS does have symlinks Perl understands, but underlying support is version-specific, volume-specific, and configuration-specific. If Perl ever added support for Windows symlinks (which I believe, but am not certain is still not present), it would only be on NTFS and only on certain versions of Windows. Thus the patch is correct in saying, "false if symlinks aren't supported by the file system," as it depends on capabilities of a specific volume or file system in addition to platform capabilities. Show quoted text
> Further, there are subtle differences between > return undef; > vs > return; > > Thus, a patch that correctly documents the behavior for this circumstance > seems to me to be an improvement that will help out people trying to use > Perl.
I agree. Now, about all of those blockers we haven't fixed yet....
From: Eric Brine <ikegami [...] adaelis.com>
To: Karl Williamson <public [...] khwilliamson.com>
Date: Wed, 2 Apr 2014 15:24:29 -0400
Subject: Re: [perl #121523] [PATCH] Document -l on symlinkless file systems
CC: "Craig A. Berry" <craig.a.berry [...] gmail.com>, Dave Mitchell <davem [...] iabyn.com>, Smylers <smylers [...] stripey.com>, Eric Brine via RT <perlbug-followup [...] perl.org>
Download (untitled) / with headers
text/plain 512b
On Wed, Apr 2, 2014 at 1:45 PM, Karl Williamson <public@khwilliamson.com> wrote:
Show quoted text
Further, there are subtle differences between
        return undef;
vs
        return;

Thus, a patch that correctly documents the behavior for this circumstance seems to me to be an improvement that will help out people trying to use Perl.  I count myself as one of them.

It shouldn't be returning either!

>perl -wE"my @rv = -l 'a'; say 0+@rv; say defined($rv[0])?1:0; say $rv[0]?1:0;"
1
1
0
 
Good. It doesn't.

RT-Send-CC: perl5-porters [...] perl.org
On Fri Mar 28 09:37:49 2014, smylers@stripey.com wrote: Show quoted text
> Documenting Zefram's reply to Dave M's question about -l: > http://www.nntp.perl.org/group/perl.perl5.porters/2014/03/msg214012.html
There's a gap in the implementation too, while it would be almost pointless to implement symlink() on Win32[1], perhaps -l should work: J:\>perl -le "print 'link ', -l shift() ? 'yes' : 'no'" test link no J:\>dir Volume in drive J is SSD Volume Serial Number is 742B-DD2C Directory of J:\ 11/02/2014 03:11 PM <DIR> dev 14/04/2014 03:02 PM 461 end 25/03/2014 08:06 AM <DIR> games 05/02/2014 11:06 AM <DIR> steam 14/04/2014 03:02 PM <SYMLINK> test [end] 10/04/2014 11:28 AM <DIR> VMs 2 File(s) 461 bytes 4 Dir(s) 176,709,697,536 bytes free That said, implementing it would require a re-write of win32_stat(), since _stat()/_stati64() doesn't appear to return the appropriate flags. Tony [1] it requires admin access
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 230b
On Fri Mar 28 09:37:49 2014, smylers@stripey.com wrote: Show quoted text
> Documenting Zefram's reply to Dave M's question about -l: > http://www.nntp.perl.org/group/perl.perl5.porters/2014/03/msg214012.html
I plan to apply this for 5.21.1. Tony
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 258b
On Fri Mar 28 09:37:49 2014, smylers@stripey.com wrote: Show quoted text
> Documenting Zefram's reply to Dave M's question about -l: > http://www.nntp.perl.org/group/perl.perl5.porters/2014/03/msg214012.html
Thanks, applied as ae07d0f95d9614b1ffea793b6ac5f2ffa324cb44. Tony


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org