In article <9888DBB2-0FE8-4C5C-8EF0-02D7C30157FA / pragprog.com>,
  Dave Thomas <dave / pragprog.com> writes:

> But we also quite often want to work the the whole file. I believe  
> Matz uses the example of something like
>
> data = File.open("dave.gif", "b:ASCII-8BIT").read
> fail unless data =~ /^GIF/

"rb:ASCII-8BIT"?  It works.

Just "rb" also works for /^GIF/.

> Binary doesn't always mean bytes--it just means that you don't have a  
> consistent encoding throughout the file. So I'd strongly support the  
> idea of "b" defaulting to a binary encoding.

I think what we need is File.binread(filename).
matz doesn't accept it yet, though.
-- 
Tanaka Akira