|
|
|
[
Permlink
| « Hide
]
Vladimir Sizikov - 10/Apr/08 11:46 AM
For me, on Vista, File.stat on very long file (7Gb) actually reports the NEGATIVE file size!
confirmed that 2**^32 bytes is the boundary on linux.
not an issue on osx 10.5 w/ trunk On Windows you're going to need _stat64().
See win32-file for how I implement some of the other File functions that are broken, wrong or unimplemented in MRI. I noticed an issue with this on ino on Solaris. We need to make sure that JNA-POSIX deals with unsigned values which get forced into Java signed values.
As per our discussion on #jruby, the solution for Windows is to map stat to _stat64 in the mapping file.
As for Solaris, watch out for this bug: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/9926 jna-posix.jar updated in commit 6785 to fix this.
[ludi@localhost ludicrous]$ ruby -e "p File.stat('../bigfile')"
#<File::Stat dev=0xfd00, ino=22380573, mode=0100664, nlink=1, uid=500, gid=500, rdev=0x0, size=4294967296, blksize=4096, blocks=8396808, atime=Fri May 23 11:57:13 -0500 2008, mtime=Fri May 23 12:09:10 -0500 2008, ctime=Fri May 23 12:09:10 -0500 2008> [ludi@localhost ludicrous]$ jruby -e "p File.stat('../bigfile')" -e:1: No such file or directory - No such file or directory - /home/ludi/ludicrous/../bigfile (Errno::ENOENT) Confirmed on Windows Vista. Revision r6801 re-introduced the problem back.
Fixed in commit 6851 on trunk (I did something stupid at some point and put partially updated jna-posix jar in trunk). Up to date one there now.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||