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

[perl #109104] File::Copy should use: no warnings 'newline'

From:
SN
Date:
January 26, 2012 11:54
Subject:
[perl #109104] File::Copy should use: no warnings 'newline'
Message ID:
rt-3.6.HEAD-14510-1327580696-1483.109104-75-0@perl.org
# New Ticket Created by  SN 
# Please include the string:  [perl #109104]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=109104 >


(...)
generated with the help of perlbug 1.39 running under perl 5.12.4.


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

perl -MFile::Copy -we 'copy("/tmp/s/a", "/tmp/d/a\nb")'
If /tmp/d/a\nb (yep, file containing a newline char) doesn't exist,
the warnings:

Unsuccessful stat on filename containing newline at  
/usr/lib/perl5/5.12.4/File/Copy.pm line 152.
Unsuccessful stat on filename containing newline at  
/usr/lib/perl5/5.12.4/File/Copy.pm line 160.

are issued.
Maybe the module should use no warnings 'newline'?

It can be common if we traverse dirs, encounter a file name "a\nb"
and execute copy($src, $dst) with $dst being destination_dir/a\nb.
In such situation this warning is bogus...

Thanks!

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

Configured by Gentoo at Sun Nov 13 08:50:45 UTC 2011.

Summary of my perl5 (revision 5 version 12 subversion 4) configuration:

   Platform:
     osname=linux, osvers=3.0.0-sabayon, archname=i686-linux-thread-multi
     uname='linux orion.sabayon.org 3.0.0-sabayon #1 smp wed aug 31  
05:36:15 utc 2011 i686 amd opteron(tm) processor 6128 authenticamd  
gnulinux '
     config_args='-des -Duseshrplib -Darchname=i686-linux-thread  
-Dcc=i686-pc-linux-gnu-gcc -Doptimize=-O2 -march=i686 -pipe  
-Dldflags=-Wl,-O1,--as-needed -Dprefix=/usr -Dsiteprefix=/usr  
-Dvendorprefix=/usr -Dscriptdir=/usr/bin -Dprivlib=/usr/lib/perl5/5.12.4  
-Darchlib=/usr/lib/perl5/5.12.4/i686-linux-thread-multi  
-Dsitelib=/usr/lib/perl5/site_perl/5.12.4  
-Dsitearch=/usr/lib/perl5/site_perl/5.12.4/i686-linux-thread-multi  
-Dvendorlib=/usr/lib/perl5/vendor_perl/5.12.4  
-Dvendorarch=/usr/lib/perl5/vendor_perl/5.12.4/i686-linux-thread-multi  
-Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3  
-Dsiteman1dir=/usr/share/man/man1 -Dsiteman3dir=/usr/share/man/man3  
-Dvendorman1dir=/usr/share/man/man1 -Dvendorman3dir=/usr/share/man/man3  
-Dman1ext=1 -Dman3ext=3pm -Dlibperl=libperl.so.5.12.4 -Dlocincpth=   
-Duselargefiles -Dd_semctl_semun -Dcf_by=Gentoo -Dmyhostname=localhost  
-Dperladmin=root@localhost -Dinstallusrbinperl=n -Ud_csh -Uusenm -Di_ndbm  
-Di_gdbm -Di_db -Dusethreads -DDEBUGGING=none  
-Dinc_version_list=5.12.3/i686-linux-thread-multi 5.12.3  
5.12.2/i686-linux-thread-multi 5.12.2 5.12.1/i686-linux-thread-multi  
5.12.1 5.12.0/i686-linux-thread-multi 5.12.0 '
     hint=recommended, useposix=true, d_sigaction=define
     useithreads=define, usemultiplicity=define
     useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
     use64bitint=undef, use64bitall=undef, uselongdouble=undef
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='i686-pc-linux-gnu-gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE  
-fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
     optimize='-O2 -march=i686 -pipe',
     cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe'
     ccversion='', gccversion='4.6.2', gccosandvers=''
     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
     ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',  
lseeksize=8
     alignbytes=4, prototype=define
   Linker and Libraries:
     ld='i686-pc-linux-gnu-gcc', ldflags ='-Wl,-O1,--as-needed  
-L/usr/local/lib'
     libpth=/usr/local/lib /opt/intel/Compiler/11.1/056/lib/ia32 /lib  
/usr/lib
     libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc  
-lgdbm_compat
     perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
     libc=/lib/libc-2.13.so, so=so, useshrplib=true,  
libperl=libperl.so.5.12.4
     gnulibc_version='2.13'
   Dynamic Linking:
     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
     cccdlflags='-fPIC', lddlflags='-shared -O2 -march=i686 -pipe  
-L/usr/local/lib -Wl,-O1,--as-needed'

Locally applied patches:
     0001-gentoo_MakeMaker-RUNPATH.diff
     0002-gentoo_config_over.diff
     0003-gentoo_cpan_definstalldirs.diff
     0004-gentoo_cpanplus_definstalldirs.diff
     0005-gentoo_create-libperl-soname.diff
     0006-gentoo_MakeMaker-delete_packlist.diff
     0007-fixes_8d66b3f9_h2hp_fix.diff
     0008-fixes_f178b03b_h2ph_using_deprecated_goto.diff
     0009-gentoo_mod-paths.diff
     0010-gentoo_enc2xs.diff
     0011-gentoo_IO-Compress_AutoLoader_dropped_from_Compress-Zlib.diff
     0012-gentoo_drop-fstack-protector.diff

---
@INC for perl 5.12.4:
     /etc/perl
     /usr/lib/perl5/site_perl/5.12.4/i686-linux-thread-multi
     /usr/lib/perl5/site_perl/5.12.4
     /usr/lib/perl5/vendor_perl/5.12.4/i686-linux-thread-multi
     /usr/lib/perl5/vendor_perl/5.12.4
     /usr/lib/perl5/site_perl/5.12.2/i686-linux-thread-multi
     /usr/lib/perl5/site_perl/5.12.2
     /usr/lib/perl5/site_perl
     /usr/lib/perl5/vendor_perl/5.12.3/i686-linux-thread-multi
     /usr/lib/perl5/vendor_perl/5.12.3
     /usr/lib/perl5/vendor_perl/5.12.2/i686-linux-thread-multi
     /usr/lib/perl5/vendor_perl/5.12.2
     /usr/lib/perl5/vendor_perl
     /usr/lib/perl5/5.12.4/i686-linux-thread-multi
     /usr/lib/perl5/5.12.4
     /usr/local/lib/site_perl
     .

---
Environment for perl 5.12.4:
     HOME=/home/sn
     LANG=pl_PL.UTF-8
     LANGUAGE (unset)
     LD_LIBRARY_PATH (unset)
     LOGDIR (unset)
     PATH=/home/sn/misc/bin:/home/sn/misc/opt/bin:/home/sn/misc/bin:/home/sn/misc/opt/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.6.2:/usr/games/bin:/usr/sbin/:/sbin/:/usr/sbin/:/sbin/
     PERL_BADLANG (unset)
     SHELL=/bin/bash




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