Re: ruby File#sysread
by Bill Kelly other posts by this author
Jun 14 2007 9:06PM messages near this date
Re: ruby File#sysread
|
Re: ruby File#sysread
From: "James Milner" <bladeon@[...].com>
> Tim Hunter wrote:
> > Aatch wrote:
> >> I am attempting to create a program that can transfer files. It so far
> >> can send pure-text files no problem, but it has issues with reading
> >> anything else. EG. It cut a 6 MB mp3 down to a 6 kb file.
> >>
> >
> > On Windows? "rb"
>
> <.< >.> yes. I have no other choice. But yes, I was thinking it might be
> windows fault
Just in case the answer wasn't clear, Windows pretends that "text" files
are different from "binary" files.
So you'll want to use "binary mode" to read/write binary files on Windows.
Thus, use "rb" instead of "r" to read a binary file, and "wb" instead of "w"
to write a binary file.
Hope this helps,
Bill
Thread:
Aatch
Tim Hunter
Bill Kelly
Aatch Random
Nobuyoshi Nakada
James Milner
|