From: Phrogz Date: 2007-10-04T23:05:11+09:00 Subject: Re: Binary data, command output, and Ruby On Oct 3, 10:06 pm, "Daniel Sheppard" wrote: > > good = File.open( 'gkhead.jpg', 'rb' ){ |f| f.read } > > test = `curl -shttp://phrogz.net/tmp/gkhead.jpg` > > I would hazard a guess that if you took that 'b' off of the File.open, > you'd get the same bytes `` is returning? I doubt it, but will try when I get into work. My understanding was that (on Windows) opening a file without 'b' "helpfully" converts \n bytes to \r\n pairs; the 'b' is needed to say "Hey, don't be munging my data!". But like I said, I'll give it a shot.