New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stat() returns bad value for ino on Windows for Active Perl #9719
Comments
From vassili.gorshkov@associates.dhs.govProblem: stat function return incorrect value for 'ino' field on This works fine with cygwin perl. ####################################### # Start the test case ####################################### my $filename = "myfile.txt"; my @fs = stat($filename); open $fh, "< " . $filename or die "create a file \"$filename\" to my $ino = $fs[1]; $ino != 0 or die "bad ino value from stat, this works OK with cygwin print "Got a good ino value $ino\n"; ####################################### # End the test case ####################################### Flags: category= severity= Site configuration information for perl 5.10.0: Configured by SYSTEM at Wed Sep 3 13:16:08 2008. Summary of my perl5 (revision 5 version 10 subversion 0) configuration: Platform: osname=MSWin32, osvers=5.00, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=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', ccflags ='-DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT optimize='-O2', cppflags='-DWIN32' ccversion='', gccversion='undef', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', alignbytes=8, prototype=define Linker and Libraries: ld='g++', ldflags ='-L"C:\Perl\lib\CORE"' libpth=\lib libs=-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 perllibs=-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl510.lib gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-mdll -L"C:\Perl\lib\CORE"' Locally applied patches: ACTIVEPERL_LOCAL_PATCHES_ENTRY 33741 avoids segfaults invoking S_raise_signal() (on Linux) 33763 Win32 process ids can have more than 16 bits 32809 Load 'loadable object' with non-default file extension 32728 64-bit fix for Time::Local @INC for perl 5.10.0: c:/perl/site/lib c:/perl/lib . Environment for perl 5.10.0: HOME (unset) LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=c:\perl\bin;C:\Program Files\IBM\GSK5\lib;C:\Program PERL_BADLANG (unset) SHELL (unset) |
From @jkeenanOn Thu Apr 23 10:40:15 2009, vassili.gorshkov@associates.dhs.gov wrote:
Is there anyone on win32, particularly Active Perl, who could confirm Thank you very much. |
The RT System itself - Status changed from 'new' to 'open' |
From @bulk88On Mon Aug 13 16:58:57 2012, jkeenan wrote:
Using Perl 5.17 VS 2003 DEBUGGING build, NTFS C: disk. WinXP. C:\Documents and Settings\Owner\Desktop> C:\Documents and Settings\Owner\Desktop> |
From @jkeenanOn Mon Aug 13 21:04:46 2012, bulk88 wrote:
On IRC #p5p, bulk88 indicated that he thought this ticket should be closed. Am taking it for the purpose of closing it within 7 days unless there is compelling reason to keep it open. Thank you very much. -- |
From @jkeenanOn Tue Oct 06 18:42:04 2015, jkeenan wrote:
No one spoke up in favor of keeping this ticket open; closing. Thank you very much. -- |
@jkeenan - Status changed from 'open' to 'rejected' |
From @bulk88On Tue Oct 06 18:42:04 2015, jkeenan wrote:
I'll add my IRC comments to this ticket. Perl's Win32 stat is already 6-10 IO calls http://perl5.git.perl.org/perl.git/blob/HEAD:/win32/win32.c#l1457 . Too many of them. Getting the inode will be another 1 or 3 IO calls (open handle, query handle (FileInternalInformation), close handle). AFAIK there are 2 purposes to knowing the inode. Detecting links (same file) and undeleting files. Since hardlinks are rare on Win32, and AFAIK you can't undelete a file, there isn't much use in knowing the inode. Since it hasn't been known for 15 years on Win32 Perl to Perl code, it can continue to be unknown. I'd only support the idea of more IO calls for win32 stat if it is turned on with hints hash/"use feature" which has a fast execution path for "no feature" branch if I am reading FEATURE_IS_ENABLED macro correctly. Ignoring my IRC comments, actually, maybe inode is already being fetched by win32_stat, https://msdn.microsoft.com/en-us/library/windows/desktop/aa363788%28v=vs.85%29.aspx win32 API (not Native API) GetFileInformationByHandle has a nFileIndexHigh and a nFileIndexLow member which are the inode number. win32_stat already has a GetFileInformationByHandle call in perl c code. It would be trivial to copy the inode number over, but the MS stat_t struct has st_ino as a 16 bit short. Not enough space to store a 64 bit kernel inode. Changing perl's Stat_t type to a custom perl type and not MS libc type would be required. Also Perl already ***ROUNDS*** the inode number if inode type > UV type. http://perl5.git.perl.org/perl.git/commitdiff/8d8cba88681398d40004e97bcb93f7f8b88ae05e I think that is questionable. Perhaps a die if > 2^53 is appropriate than rounding inodes, which I say is the same thing and as dangerous as stuffing C pointers into FPs and rounding them, then derefing/comparing them. Final opinion, it could be done, but no demand for it, so keep the ticket closed. If I ever get the itch I'll implement it with a custom Stat_t type, along with a fix for https://rt-archive.perl.org/perl5/Ticket/Display.html?id=121448 . -- |
Migrated from rt.perl.org#65052 (status was 'rejected')
Searchable as RT65052$
The text was updated successfully, but these errors were encountered: