>uname -a
Linux enterprise 2.6.37.6-foken #2 SMP Sun Aug 14 02:20:59 CEST 2011 x86_64 AMD Athlon(tm) II Neo N36L Dual-Core Processor AuthenticAMD GNU/Linux
>perl -E '$file=q[""]; say (-e($file) ? "yes" : "no")'
no
>perl -V
Summary of my perl5 (revision 5 version 12 subversion 3) configuration:
Platform:
osname=linux, osvers=2.6.35.10, archname=x86_64-linux-thread-multi
uname='linux midas64 2.6.35.10 #2 smp thu jan 6 19:06:19 cst 2011 x86_64 amd athlon(tm) ii x2 235e processor authenticamd gnulinux '
config_args='-de -Dprefix=/usr -Dvendorprefix=/usr -Dcccdlflags=-fPIC -Dinstallprefix=/usr -Dlibpth=/usr/local/lib64 /usr/lib64 /lib64 -Doptimize=-O2 -fPIC -Dusethreads -Duseithreads -Dpager=/usr/bin/less -isr -Dinc_version_list=5.12.2 5.12.1 5.12.0 5.10.1 5.10.0 5.8.8 5.8.7 5.8.6 5.8.5 5.8.4 5.8.3 5.8.2 5.8.1 5.8.0 -Darchname=x86_64-linux'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2 -fPIC',
cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
ccversion='', gccversion='4.5.2', 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='cc', ldflags =' -fstack-protector'
libpth=/usr/local/lib64 /usr/lib64 /lib64
libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=/lib64/libc-2.12.2.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.12.2'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -O2 -fPIC -fstack-protector'
Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_64_BIT_ALL
USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API
Built under linux
Compiled at Jan 26 2011 12:39:46
%ENV:
PERL_UNICODE="SDL"
@INC:
/usr/lib64/perl5/site_perl/5.12.3/x86_64-linux-thread-multi
/usr/lib64/perl5/site_perl/5.12.3
/usr/lib64/perl5/vendor_perl/5.12.3/x86_64-linux-thread-multi
/usr/lib64/perl5/vendor_perl/5.12.3
/usr/lib64/perl5/5.12.3/x86_64-linux-thread-multi
/usr/lib64/perl5/5.12.3
/usr/lib64/perl5/site_perl
/usr/lib64/perl5/vendor_perl
.
####
C:\Users\alex>perl -E "$file=chr(34).chr(34); say $file.' '.(-e($file) ? 'yes' : 'no')"
"" yes
C:\Users\alex>ver
Microsoft Windows [Version 6.1.7601]
C:\Users\alex>dir
Volume in drive C is System
Volume Serial Number is B663-2E5B
Directory of C:\Users\alex
24.06.2012 19:12 .
24.06.2012 19:12 ..
25.05.2012 23:46 .gegl-0.0
24.06.2012 19:21 .gimp-2.6
24.06.2012 19:12 6.262 .recently-used.xbel
28.05.2012 14:19 .thumbnails
06.05.2012 23:44 Contacts
24.06.2012 19:12 Desktop
24.06.2012 19:41 Documents
01.07.2012 19:22 Downloads
24.06.2012 19:32 Favorites
06.05.2012 23:44 Links
16.06.2012 12:54 Music
25.05.2012 23:50 Pictures
06.05.2012 23:44 Saved Games
06.05.2012 23:44 Searches
06.05.2012 23:44 Videos
15.06.2012 21:05 Virtual Machines
1 File(s) 6.262 bytes
17 Dir(s) 11.921.534.976 bytes free
C:\Users\alex>perl -V
Summary of my perl5 (revision 5 version 14 subversion 2) configuration:
Platform:
osname=MSWin32, osvers=4.0, archname=MSWin32-x64-multi-thread
uname='Win32 strawberryperl 5.14.2.1 #1 Tue Nov 22 22:40:59 2011 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 -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -mms-bitfields',
optimize='-s -O2',
cppflags='-DWIN32'
ccversion='', gccversion='4.4.7', 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++', ldflags ='-s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib"'
libpth=C:\strawberry\c\lib C:\strawberry\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=libperl514.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-mdll -s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib"'
Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS
PERL_MALLOC_WRAP PERL_PRESERVE_IVUV PL_OP_SLAB_ALLOC
USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
USE_PERLIO USE_PERL_ATOF USE_SITECUSTOMIZE
Built under MSWin32
Compiled at Nov 22 2011 22:53:05
%ENV:
PERL_JSON_BACKEND="JSON::XS"
PERL_YAML_BACKEND="YAML"
@INC:
C:/strawberry/perl/site/lib
C:/strawberry/perl/vendor/lib
C:/strawberry/perl/lib
.
C:\Users\alex>
####
C:\Users\alex>perl -E "stat(chr(34).chr(34)) or die $!; say 'huh?'"
huh?
C:\Users\alex>
####
>perl -E 'stat(q[""]) or die $!; say "huh?"'
No such file or directory at -e line 1.
>
####
C:\Users\alex>perl -MData::Dumper -E "@a=stat(chr(34).chr(34)) or die $!; say Du
mper(\@a)"
$VAR1 = [
2, # device
0, # inode
16895, # mode = 0x41FF = 040777
1, # nlink
0, # uid
0, # gid
2, # rdev
0, # size
1340557931, # atime
1340557931, # mtime
1336337436, # ctime
'', # blocksize
'' # blocks
];
C:\Users\alex>
####
C:\Users\alex>perl -MData::Dumper -E "for $x (chr(34).chr(34),'.','..') { @a=stat($x); say Dumper(\@a) }"
$VAR1 = [
2,
0,
16895,
1,
0,
0,
2,
0,
1340557931,
1340557931,
1336337436,
'',
''
];
$VAR1 = [
2,
0,
16895,
1,
0,
0,
2,
0,
1340557931,
1340557931,
1336337436,
'',
''
];
$VAR1 = [
2,
0,
16749,
1,
0,
0,
2,
0,
1339842184,
1339842184,
1247541608,
'',
''
];
C:\Users\alex>
####
C:\Users\alex>perl -MData::Dumper -E "@a=stat(chr(34).'Desktop'.chr(34)); say Dumper(\@a)"
$VAR1 = [];
C:\Users\alex>perl -MData::Dumper -E "@a=stat(''); say Dumper(\@a)"
$VAR1 = [];
C:\Users\alex>perl -MData::Dumper -E "@a=stat(chr(34).'..'.chr(34)); say Dumper(\@a)"
$VAR1 = [];
C:\Users\alex>perl -MData::Dumper -E "@a=stat(chr(34).'.'.chr(34)); say Dumper(\@a)"
$VAR1 = [];
C:\Users\alex>
####
#include
#include
#include
#include
int main(int argc, char ** argv)
{
struct stat st;
printf("stat(\"\") = %i\n",stat("\"\"",&st));
return 0;
}
####
X:\>gcc -o stattest.exe stattest.c
X:\>stattest
stat("") = -1
X:\>