From: djberg96@... (Daniel Berger) Date: 2004-11-25T01:08:00+09:00 Subject: Re: Correct File.size Tomas Brixi wrote in message news:<20041124111513.50696.qmail@web41502.mail.yahoo.com>... > Hello, > > how do I get a correct size of file larger than 4GB? > File.size( "filename" ) alway return some negative number. It seems to be some integer overflow. > I use latest rubyinstaller.rubyforge.org instalation package on winxpsp2 > > Regards > > Tom I don't know why we can't get 64bit support for Windows. This bit of C code works fine: #include #include #include //_INTEGRAL_MAX_BITS int main() { char* filename = "C:\\delete_this\\big_file.txt"; struct _stati64 buf; unsigned __int64 result; result = _stati64( filename, &buf ); if( result != 0 ) { perror( "Problem getting information" ); } else { printf( "File size : %lu\n", buf.st_size ); } return 0; } See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/pgalpha98/html/int64.asp I'll probably just implement File.size in the win32-file package, using GetFileSizeEx() until this works as it should. Regards, Dan