develooper Front page | perl.perl5.porters | Postings from May 2015

[perl #124443] Function lstat behavior case differs between Windows and Unix

Thread Previous
From:
perlbug-followup
Date:
May 3, 2015 04:18
Subject:
[perl #124443] Function lstat behavior case differs between Windows and Unix
Message ID:
rt-4.0.18-13534-1430591443-1887.124443-75-0@perl.org
# New Ticket Created by   
# Please include the string:  [perl #124443]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=124443 >



This is a bug report for perl from rich@richelberger.com,
generated with the help of perlbug 1.40 running under perl 5.20.2.


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

Please refer to RT 90452 for background and original symptom. #NYCHackathon

In regular shells, the path expression ‘foo/…’ should fail and return an empty list.

<code>
use strict; use warnings; use 5.10.00;
mkdir a;
my @result = lstat ‘a/…’;
say for @result;
</code>

In Linux / Mac, it results in an empty array since it is file not found.
On Windows, the result is:

$VAR1 = 0;
$VAR2 = 0;
$VAR3 = 16832;
$VAR4 = 0;
$VAR5 = 0;
$VAR6 = 0;
$VAR7 = 0;
$VAR8 = 0;
$VAR9 = 0;
$VAR10 = 0;
$VAR11 = 0;
$VAR12 = '';
$VAR13 = '';



[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=medium
---
Site configuration information for perl 5.20.2:

Configured by rich at Tue Feb 24 17:10:19 EST 2015.

Summary of my perl5 (revision 5 version 20 subversion 2) configuration:
   
  Platform:
    osname=darwin, osvers=14.1.0, archname=darwin-2level
    uname='darwin ananke 14.1.0 darwin kernel version 14.1.0: mon dec 22 23:10:38 pst 2014; root:xnu-2782.10.72~2release_x86_64 x86_64 '
    config_args='-de -Dprefix=/Users/rich/perl5/perlbrew/perls/perl-5.20.1 -Aeval:scriptdir=/Users/rich/perl5/perlbrew/perls/perl-5.20.1/bin'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include',
    optimize='-O3',
    cppflags='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)', 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='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib /usr/lib
    libs=-ldbm -ldl -lm -lutil -lc
    perllibs=-ldl -lm -lutil -lc
    libc=, so=dylib, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector'

Locally applied patches:
    Devel::PatchPerl 1.30

---
@INC for perl 5.20.2:
    /Users/rich/perl5/perlbrew/perls/perl-5.20.1/lib/site_perl/5.20.2/darwin-2level
    /Users/rich/perl5/perlbrew/perls/perl-5.20.1/lib/site_perl/5.20.2
    /Users/rich/perl5/perlbrew/perls/perl-5.20.1/lib/5.20.2/darwin-2level
    /Users/rich/perl5/perlbrew/perls/perl-5.20.1/lib/5.20.2
    /Users/rich/perl5/perlbrew/perls/perl-5.20.1/lib/site_perl/5.20.1
    /Users/rich/perl5/perlbrew/perls/perl-5.20.1/lib/site_perl
    .

---
Environment for perl 5.20.2:
    DYLD_LIBRARY_PATH (unset)
    HOME=/Users/rich
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/local/texlive/2014/bin/universal-darwin:/Users/rich/perl5/perlbrew/bin:/Users/rich/perl5/perlbrew/perls/perl-5.20.1/bin:/usr/local/git/bin:/opt/subversion/bin:/Users/rich/bin:/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/texbin
    PERLBREW_BASHRC_VERSION=0.72
    PERLBREW_HOME=/Users/rich/.perlbrew
    PERLBREW_MANPATH=/Users/rich/perl5/perlbrew/perls/perl-5.20.1/man
    PERLBREW_PATH=/Users/rich/perl5/perlbrew/bin:/Users/rich/perl5/perlbrew/perls/perl-5.20.1/bin
    PERLBREW_PERL=perl-5.20.1
    PERLBREW_ROOT=/Users/rich/perl5/perlbrew
    PERLBREW_VERSION=0.72
    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