------art_19505_19850900.1145497382923
Content-Type: text/plain; charset=ISO-2022-JP
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

HiĄ¤

oh, yes, File.new("1.mp3","wb"), it's OK now.
thanks.
i like ruby and the ruby community. Ruby maks programing easy and fun.

xiaofeng


On 4/20/06, Guillaume Benny <guillaume.benny / sympatico.ca> wrote:
>
>
> > Xiaofeng Qiu wrote:
> >
> > i tried on my first ruby program, downloading a MP3 file:
> >
> >   require 'net/http'
> >         req,body  et::HTTP::get_response('*.*.net','/../1.mp3')
> >         f  ile.new("1.mp3", "w")
> >     f.write body
> >
> > it does work !
> > but the file size is 5479K  about 30K more  than  downloading  by  IE.
> > And
> > it sounds terrible when i replay the MP3.
> > Does any one kown the reason?
> >
> > xiaofeng
>
> Hi,
>
> If you are under windows, you should try the "binary" mode:
>
> f  ile.new("1.mp3", "wb")
>
> or else the file might be corrupted: \n will turn into \r\n (or \n\r, I
> can
> never remember).
>
> Hope this helps,
>
> Guillaume
>
>
>
>

------art_19505_19850900.1145497382923--