From: Milan Maksimovic Date: 2002-12-28T20:51:23+09:00 Subject: WARN: mswin32 build binary file read change of behavior Hello, Maybe it's been mentioned before, but since I've spent some time looking for error in my code (things broke), here it goes anyway, in case somebody runs into this issue (low chance, this mostly being Linux crowd, but still...). Maybe putting it in a FAQ isn't a bad idea. On cygwin builds: File.open( 'somebinaryfile.bin' ) do | file | binaryContent = file.read() end worked fine, i.e. it read all that it should have. In mswin32 builds one must explicitly specify "rb" flags. File.open( 'somebinaryfile.bin', "rb" ) or the file will be truncated. I suppose it would be good to have it fixed in mswin32 build, since a major practical consequence is that libraries and programs that don't take this into consideration (like those done on Unix flavors and used on Win32) will break. In my case it was a SMTP/MIME thingie. ( .pack("m") failed to produce proper content). Regards, M.