From: Frank Polscheit Date: 2003-06-13T04:40:16+09:00 Subject: AW: file I/O: how can I disable auto-convert of the 2-byte sequence 0x0D, 0x0A into a single byte '\n'? Thank you for helping. For all, interesting in this question: alternativ to the method "binmode", it works with File.new("test.dat", "rb") as well, opening the binary-IO. Cheers, Frank -----Urspr�ngliche Nachricht----- Von: Pierre Baillet [mailto:oct@zoy.org] Gesendet: Dienstag, 3. Juni 2003 13:38 An: ruby-talk@ruby-lang.org Cc: rheinmainruby@eylerfamily.org Betreff: Re: file I/O: how can I disable auto-convert of the 2-byte sequence 0x0D, 0x0A into a single byte '\n'? On Tue, Jun 03, 2003, Polscheit, Frank wrote: > > # input file "test.dat" contains 2 bytes: 0x0D and 0x0A > # the result file should contain 0x0A 0x0D in this example > > dest = File.new("test.dat", "r") Have you tried switching to binary mode ? dest.binmode Cheers ! -- Pierre Baillet Avec un escalier pr�vu pour la mont�e, on reussi souvent � monter plus bas qu'on ne serait descendu avec un escalier pr�vu pour la descente. Devise Shadok