# New Ticket Created by [EMAIL PROTECTED] # Please include the string: [perl #36507] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=36507 >
This is a bug report for perl from [EMAIL PROTECTED], generated with the help of perlbug 1.35 running under perl v5.8.6. ----------------------------------------------------------------- [Please enter your report here] copy() will die (not warn) if you attempt to copy a file to itself. 0 ~$ perl -MFile::Copy -wle 'copy("this", "this"); print "After death"' 'this' and 'this' are identical (not copied) at -e line 1 It even goes so far as to check if they're linked (soft or hard). 0 /tmp$ touch foo 0 /tmp$ ln foo bar 0 /tmp$ perl -MFile::Copy -wle 'copy("foo", "bar"); print "After death"' 'foo' and 'bar' are identical (not copied) at -e line 1 This behavior was introduced in rt.perl.org 5196 and patch #11526. http://public.activestate.com/cgi-bin/perlbrowse?patch=11526 While I have no problem with the check, I feel dying is unwarrented. Nothing failed to work. The copy succeeded in that both files contain the same data. The fact that trying to copy one linked file over another dies can lead to surprises as programs die on otherwise innocent operations. Copying a file over itself is dubious but not an error. That's what warnings are for. It should be downgraded to a warning. [Please do not change anything below this line] ----------------------------------------------------------------- --- Flags: category=library severity=low --- Site configuration information for perl v5.8.6: Configured by schwern at Tue May 10 16:13:13 PDT 2005. Summary of my perl5 (revision 5 version 8 subversion 6) configuration: Platform: osname=darwin, osvers=7.9.0, archname=darwin-thread-multi-2level uname='darwin windhund.schwern.org 7.9.0 darwin kernel version 7.9.0: wed mar 30 20:11:17 pst 2005; root:xnuxnu-517.12.7.obj~1release_ppc power macintosh powerpc ' config_args='-des -Dcc=gcc-3.3 -Dcpp=gcc-3.3 -E -Dprefix=/sw -Dvendorprefix=/sw -Dccflags=-I/sw/include -Dldflags=-L/sw/lib -Dperladmin=none -Uinstallusrbinperl -Dprivlib=/sw/lib/perl5-core/5.8.6 -Dman3dir=/sw/lib/perl5-core/5.8.6/man/man3 -Dman3ext=3pm -Dvendorlib=/sw/lib/perl5/5.8.6 -Dvendorman3dir=/sw/lib/perl5/5.8.6/man/man3 -Duseithreads -Dinc_version_list=5.8.1 5.8.0 5.6.0 -Adefine:startperl=#!/sw/bin/perl5.8.6 -Dotherlibdirs=/Library/Perl' 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=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc-3.3', ccflags ='-I/sw/include -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe', optimize='-Os', cppflags='-no-cpp-precomp -I/sw/include -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe' ccversion='', gccversion='3.3 20030304 (Apple Computer, Inc. build 1671)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags ='-L/sw/lib -L/usr/local/lib' libpth=/usr/local/lib /usr/lib libs=-ldbm -ldl -lm -lc perllibs=-ldl -lm -lc libc=/usr/lib/libc.dylib, so=dylib, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dyld.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-L/sw/lib -bundle -undefined dynamic_lookup -L/usr/local/lib' Locally applied patches: --- @INC for perl v5.8.6: /sw/lib/perl5/5.8.6/darwin-thread-multi-2level /sw/lib/perl5/5.8.6 /sw/lib/perl5/5.8.1 /sw/lib/perl5 /sw/lib/perl5/darwin /sw/lib/perl5-core/5.8.6/darwin-thread-multi-2level /sw/lib/perl5-core/5.8.6 /sw/lib/perl5/site_perl/5.8.6/darwin-thread-multi-2level /sw/lib/perl5/site_perl/5.8.6 /sw/lib/perl5/site_perl /sw/lib/perl5/5.8.6/darwin-thread-multi-2level /sw/lib/perl5/5.8.6 /sw/lib/perl5/5.8.1 /sw/lib/perl5 /Library/Perl/5.8.1 /Library/Perl . --- Environment for perl v5.8.6: DYLD_LIBRARY_PATH (unset) HOME=/Users/schwern LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/Users/schwern/bin:/usr/local/bin:/Users/schwern/bin:/usr/local/bin:/sw/bin:/sw/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/schwern:/usr/X11R6/bin:.:. PERL5LIB=/sw/lib/perl5:/sw/lib/perl5/darwin PERL_BADLANG (unset) SHELL=/bin/bash