From: Heesob Park Date: 2009-03-17T12:28:02+09:00 Subject: Re: File.open().read.length result incorrect on Windows Server Hi, 2009/3/17 Aaron Chandler : > Hi, > > I need to open and read a 7.6M file on an EC2 Windows Server 2003 > machine, and when I try using: > > File.open('bigfile.flv').read.length > > the result I get is 22731 (wrong) with the last characters of the file > data being "\334r\227\000\220-". > > In comparison, when I run this same command for the same file on my Mac, > I get 7941109 (correct) with the last characters of the file data being > "\000\000\000\250" > > It appears as if the file data is being truncated in Windows. Anyone > have an idea as to why I would be seeing results like this? > Try File.open('bigfile.flv','rb').read.length Refer to http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/47209184b760c8e4/e8aca721faa8ac67 Regards, Park Heesob