develooper Front page | perl.perl5.porters | Postings from September 2013

Re: [perl #119857] [PATCH] make win32_link and win32_rename raiseENOSPC and EDQUOT when appropriate

Thread Previous | Thread Next
From:
Christian Millour
Date:
September 16, 2013 23:57
Subject:
Re: [perl #119857] [PATCH] make win32_link and win32_rename raiseENOSPC and EDQUOT when appropriate
Message ID:
52379AF2.7010203@abtela.com
Damn. I was so struggling with composing this ticket on windows that I 
succeeded in messing the patch. Please use the attached one instead.

Sorry for the noise.

Christian.


Le 17/09/2013 01:28, Christian Millour a écrit :
>
>
> This is a bug report for perl from cm.perl@abtela.com,
> generated with the help of perlbug 1.39 running under perl 5.18.1.
>
>
> -----------------------------------------------------------------
> [Please describe your issue here]
>
> The attached patch refines the mapping of windows error codes to POSIX
> ones in win32_link and win32_rename (in win32/win32.c), to use better
> values than the default (and misleading) EINVAL and EACCES respectively,
> in two cases :
>   - $^E:ERROR_DISK_FUll        => $!:ENOSPC
>   - $^E:ERROR_NOT_ENOUGH_QUOTA => $!:EDQUOT
>
> For win32_rename, I raised and tested ERROR_DISK_FULL (resp.
> ERROR_NOT_ENOUGH_QUOTA) by attempting to move a big file to a local
> partition (resp. to a NAS partition) lacking sufficient space.
>
> For win32_link, I raised and tested ERROR_DISK_FULL by attempting to
> create a number of links on a full partition.  I have only limited
> access to a NAS at a client's, and cannot test ERROR_NOT_ENOUGH_QUOTA
> right now, but I figure that if this error ever occurs then EDQUOT will
> be better than EINVAL.
>
> I can't think of a way to incorporate similar tests in the distribution.
>
> FWIW, I run into these errors with win32_rename quite frequently.  The
> same errors with win32_link are probably several orders of magnitude
> more scarce.
>
> IMO this corrects a longstanding oversight, and as such should be
> appropriate for the maintenance branch.
>
> Christian.
>
>
> [Please do not change anything below this line]
> -----------------------------------------------------------------
> ---
> Flags:
>      category=core
>      severity=low
> ---
> Site configuration information for perl 5.18.1:
>
> Configured by strawberry-perl at Tue Aug 13 17:19:29 2013.
>
> Summary of my perl5 (revision 5 version 18 subversion 1) configuration:
>
>    Platform:
>      osname=MSWin32, osvers=4.0, archname=MSWin32-x64-multi-thread
>      uname='Win32 strawberry-perl 5.18.1.1 #1 Tue Aug 13 17:18:28 2013 x64'
>      config_args='undef'
>      hint=recommended, useposix=true, d_sigaction=undef
>      useithreads=define, usemultiplicity=define
>      useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
>      use64bitint=define, use64bitall=undef, uselongdouble=undef
>      usemymalloc=n, bincompat5005=undef
>    Compiler:
>      cc='gcc', ccflags =' -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE
> -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
> -DUSE_PERLIO -fno-strict-aliasing -mms-bitfields',
>      optimize='-s -O2',
>      cppflags='-DWIN32'
>      ccversion='', gccversion='4.7.3', gccosandvers=''
>      intsize=4, longsize=4, ptrsize=8, doublesize=8, byteorder=12345678
>      d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
>      ivtype='long long', ivsize=8, nvtype='double', nvsize=8,
> Off_t='long long', lseeksize=8
>      alignbytes=8, prototype=define
>    Linker and Libraries:
>      ld='g++.exe', ldflags ='-s
> -L"C:\strawberry-perl-5.18.1.1-64bit-portable\perl\lib\CORE"
> -L"C:\strawberry-perl-5.18.1.1-64bit-portable\c\lib"'
>      libpth=C:\strawberry-perl-5.18.1.1-64bit-portable\c\lib
> C:\strawberry-perl-5.18.1.1-64bit-portable\c\x86_64-w64-mingw32\lib
>      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=libperl518.a
>      gnulibc_version=''
>    Dynamic Linking:
>      dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
>      cccdlflags=' ', lddlflags='-mdll -s
> -L"C:\strawberry-perl-5.18.1.1-64bit-portable\perl\lib\CORE"
> -L"C:\strawberry-perl-5.18.1.1-64bit-portable\c\lib"'
>
> Locally applied patches:
>
>
> ---
> @INC for perl 5.18.1:
>      C:/strawberry-perl-5.18.1.1-64bit-portable/perl/site/lib
>      C:/strawberry-perl-5.18.1.1-64bit-portable/perl/vendor/lib
>      C:/strawberry-perl-5.18.1.1-64bit-portable/perl/lib
>      .
>
> ---
> Environment for perl 5.18.1:
>      CYGWIN=nodosfilewarning
>      HOME=e:/cm
>      LANG (unset)
>      LANGUAGE (unset)
>      LD_LIBRARY_PATH (unset)
>      LOGDIR (unset)
>
> PATH=C:\strawberry-perl-5.18.1.1-64bit-portable\perl\site\bin;C:\strawberry-perl-5.18.1.1-64bit-portable\perl\bin;C:\strawberry-perl-5.18.1.1-64bit-portable\c\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0
>
>      PERL_BADLANG (unset)
>      SHELL (unset)


Thread Previous | Thread Next


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