develooper Front page | perl.perl5.porters | Postings from June 2012

[perl #113898] File::Spec::Unix->catfile("./a") ne File::Spec::Unix->catfile(".", "a")

Thread Previous
From:
perl @ profvince . com
Date:
June 29, 2012 06:29
Subject:
[perl #113898] File::Spec::Unix->catfile("./a") ne File::Spec::Unix->catfile(".", "a")
Message ID:
rt-3.6.HEAD-28836-1340974941-139.113898-75-0@perl.org
# New Ticket Created by  perl@profvince.com 
# Please include the string:  [perl #113898]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=113898 >



This is a bug report for perl from perl@profvince.com,
generated with the help of perlbug 1.39 running under perl 5.16.0.


-----------------------------------------------------------------
[Please describe your issue here]

     $ perl -MFile::Spec::Unix -le 'print File::Spec::Unix->catfile("./a")'
     a
     $ perl -MFile::Spec::Unix -le 'print File::Spec::Unix->catfile(".", 
"a")'
     ./a

I don't think those two should be different, but they are. Which form 
should be returned by catfile()? The second one has the advantage of 
being more shell-friendly : when 'a' is not in your PATH, you can do 
"system './a'" but not "system 'a'". On the other hand the first form 
comes straight from canonpath() :
     $ perl -MFile::Spec::Unix -le'print File::Spec::Unix->canonpath("./a")'
     a

and I suspect that changing this to './a' could cause a lot of breakage.


[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
     category=library
     severity=low
     module=File::Spec
---
Site configuration information for perl 5.16.0:

Configured by Gentoo at Thu Jun 14 18:45:58 CEST 2012.

Summary of my perl5 (revision 5 version 16 subversion 0) configuration:
      Platform:
     osname=linux, osvers=3.4.0-fuuka.profvince.com, archname=x86_64-linux
     uname='linux fuuka 3.4.0-fuuka.profvince.com #1 smp sat jun 2 
15:42:13 cest 2012 x86_64 intel(r) core(tm)2 duo cpu e6750 @ 2.66ghz 
genuineintel gnulinux '
     config_args='-des -Duseshrplib -Darchname=x86_64-linux 
-Dcc=x86_64-pc-linux-gnu-gcc -Doptimize=-march=core2 -O3 
-fomit-frame-pointer -ftree-vectorize -ftree-vectorizer-verbose=1 -pipe 
-DNDEBUG -Dldflags=-Wl,-O1 -Wl,--as-needed -Dprefix=/usr 
-Dinstallprefix=/usr -Dsiteprefix=/usr/local -Dvendorprefix=/usr 
-Dscriptdir=/usr/bin -Dprivlib=/usr/lib64/perl5/5.16.0 
-Darchlib=/usr/lib64/perl5/5.16.0/x86_64-linux 
-Dsitelib=/usr/local/lib64/perl5/5.16.0 
-Dsitearch=/usr/local/lib64/perl5/5.16.0/x86_64-linux 
-Dvendorlib=/usr/lib64/perl5/vendor_perl/5.16.0 
-Dvendorarch=/usr/lib64/perl5/vendor_perl/5.16.0/x86_64-linux 
-Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 
-Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 
-Dvendorman1dir=/usr/share/man/man1 -Dvendorman3dir=/usr/share/man/man3 
-Dman1ext=1 -Dman3ext=3pm -Dlibperl=libperl.so.5.16.0 
-Dlocincpth=/usr/include  -Dglibpth=/lib64 /usr/lib64  -Duselargefiles 
-Dd_semctl_semun -Dcf_by=Gentoo -Dmyhostname=localhost 
-Dperladmin=root@localhost -Dinstallusrbinperl=n -Ud_csh -Uusenm 
-Di_ndbm -Di_gdbm -Di_db -DDEBUGGING=none -Dlibpth=/usr/local/lib64 
/lib64 /usr/lib64 -Dnoextensions=ODBM_File'
     hint=recommended, useposix=true, d_sigaction=define
     useithreads=undef, usemultiplicity=undef
     useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
     use64bitint=define, use64bitall=define, uselongdouble=undef
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='x86_64-pc-linux-gnu-gcc', ccflags ='-fno-strict-aliasing -pipe 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
     optimize='-march=core2 -O3 -fomit-frame-pointer -ftree-vectorize 
-ftree-vectorizer-verbose=1 -pipe -DNDEBUG',
     cppflags='-fno-strict-aliasing -pipe'
     ccversion='', gccversion='4.6.3', 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='x86_64-pc-linux-gnu-gcc', ldflags ='-Wl,-O1 -Wl,--as-needed'
     libpth=/usr/local/lib64 /lib64 /usr/lib64
     libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
     perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
     libc=/lib/libc-2.15.so, so=so, useshrplib=true, 
libperl=libperl.so.5.16.0
     gnulibc_version='2.15'
   Dynamic Linking:
     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
     cccdlflags='-fPIC', lddlflags='-shared -march=core2 -O3 
-fomit-frame-pointer -ftree-vectorize -ftree-vectorizer-verbose=1 -pipe 
-DNDEBUG -Wl,-O1 -Wl,--as-needed'

Locally applied patches:

---
@INC for perl 5.16.0:
     /etc/perl
     /usr/local/lib64/perl5/5.16.0/x86_64-linux
     /usr/local/lib64/perl5/5.16.0
     /usr/lib64/perl5/vendor_perl/5.16.0/x86_64-linux
     /usr/lib64/perl5/vendor_perl/5.16.0
     /usr/lib64/perl5/5.16.0/x86_64-linux
     /usr/lib64/perl5/5.16.0
     .

---
Environment for perl 5.16.0:
     HOME=/home/vince
     LANG=fr_FR.UTF-8
     LANGUAGE (unset)
     LC_ALL=fr_FR.UTF-8
     LD_LIBRARY_PATH (unset)
     LOGDIR (unset)
 
PATH=/home/vince/bin:/home/vince/perl/builds/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.3:/opt/intel/cce/10.1.018/bin:/usr/games/bin
     PERL_BADLANG (unset)
     SHELL=/bin/bash


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About