develooper Front page | perl.perl5.porters | Postings from November 2014

[perl #123199] File::Copy fails to set $! on error on Win32

From:
perlbug-followup
Date:
November 13, 2014 20:45
Subject:
[perl #123199] File::Copy fails to set $! on error on Win32
Message ID:
rt-4.0.18-27973-1415893849-1507.123199-75-0@perl.org
# New Ticket Created by   
# Please include the string:  [perl #123199]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=123199 >



This is a bug report for perl from frew@cpan.org,
generated with the help of perlbug 1.40 running under perl 5.20.1.


-----------------------------------------------------------------
Basically I have this line of code:

    File::Copy::copy($tmp_fn, $full_path) or die "$!"

The $full_path above has non-existent directory, so it fails to copy entirely.

The real error does actually end up in $^E, which is how I diagnosed the issue,
but the doc says it uses $! so it probably should.
-----------------------------------------------------------------
---
Flags:
    category=library
    severity=medium
    module=File::Copy
---
Site configuration information for perl 5.20.1:

Configured by strawberry-perl at Tue Sep 16 00:55:31 2014.

Summary of my perl5 (revision 5 version 20 subversion 1) configuration:
   
  Platform:
    osname=MSWin32, osvers=6.3, archname=MSWin32-x86-multi-thread
    uname='Win32 strawberry-perl-no64 5.20.1.1 #1 Tue Sep 16 00:53:53 2014 i386'
    config_args='undef'
    hint=recommended, useposix=true, d_sigaction=undef
    useithreads=define, usemultiplicity=define
    use64bitint=undef, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags =' -s -O2 -DWIN32  -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields',
    optimize='-s -O2',
    cppflags='-DWIN32'
    ccversion='', gccversion='4.8.3', 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='long long', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='g++', ldflags ='-s -L"C:\Inetpub\strawberry\perl\lib\CORE" -L"C:\Inetpub\strawberry\c\lib"'
    libpth=C:\Inetpub\strawberry\c\lib C:\Inetpub\strawberry\c\i686-w64-mingw32\lib C:\Inetpub\strawberry\c\lib\gcc\i686-w64-mingw32\4.8.3
    libs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
    perllibs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
    libc=, so=dll, useshrplib=true, libperl=libperl520.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=xs.dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-mdll -s -L"C:\Inetpub\strawberry\perl\lib\CORE" -L"C:\Inetpub\strawberry\c\lib"'


---
@INC for perl 5.20.1:
    C:/Inetpub/lynx/strawberry/perl/site/lib
    C:/Inetpub/lynx/strawberry/perl/vendor/lib
    C:/Inetpub/lynx/strawberry/perl/lib
    .

---
Environment for perl 5.20.1:
    HOME (unset)
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=C:\Inetpub\lynx\strawberry\c\bin;C:\Inetpub\lynx\strawberry\perl\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\
    PERL_BADLANG (unset)
    SHELL (unset)




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