From: walter@... Date: 2004-03-25T07:36:10+09:00 Subject: Re: File.stat.size errors with file sizes over 2Gigs. > >>> Is there a work around? > >> > >> try: > >> [File.stat("filename").size].pack("i").unpack("I") > >> > > > > Thats cool and does work for files less than 4 gigs but (obviously) > > fails for larger files. > > whoops :/ I didn't think about that until I read your followup posting > where you said 14 gigs... > > Okay, new workaround! :) Open in append mode, read the position. > > >> File.open("/Users/mark/bigfile","a"){|f|f.pos} > => 12006195200 > > Does that work? > > --Mark > > I tried that but just got zero, so I tried File.open("file_name","a") do |f| f.seek(0, IO::SEEK_END) puts "size = #{f.pos}"} end and this works for files less than 2 gigs but for files over 2 gigs I get the following error : `seek': Invalid argument - s:\2004-03- 22\mssql\backup\ct_prod_back.DAT (Errno::EINVAL) So it seems that the same issue would be at play here as well. :-( Thanks, Walt ***************************************************** Walter Szewelanczyk IS Director M.W. Sewall & CO. email : walter@mwsewall.com 259 Front St. Phone : (207) 442-7994 x 128 Bath, ME 04530 Fax : (207) 443-6284 *****************************************************