From: "Polscheit, Frank" Date: 2003-06-03T19:55:02+09:00 Subject: file I/O: how can I disable auto-convert of the 2-byte sequence 0x0D, 0x0A into a single byte '\n'? This is a multi-part message in MIME format. ------=_NextPartTM-000-e6b0f9cb-19c9-4173-a238-8f9323ea92fc Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C329BE.86992AEC" ------_=_NextPart_001_01C329BE.86992AEC Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, does somebody know, how to disable the auto-conversion of a 2-byte sequence of 0x0D 0x0A into a single byte '\n'? I want to process binary data, which can contain such byte sequences but not idicating end-of-line as the file has a fix record length. Please take the example below: # input file "test.dat" contains 2 bytes: 0x0D and 0x0A # the result file should contain 0x0A 0x0D in this example dest =3D File.new("test.dat", "r") a =3D dest.sysread(1) # should read 1 byte (0x0D), but does read both in reality as '\n' b =3D dest.sysread(1) # should read 1 byte (0x0A), but gets EOF/nil in consequence of above dest.close dest =3D File.new("result.dat", "w") dest.syswrite(b)=20 dest.syswrite(a)=20 dest.close Best regards, Frank ------_=_NextPart_001_01C329BE.86992AEC Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable file I/O: how can I disable auto-convert of the 2-byte sequence = 0x0D, 0x0A into a single byte '\n'?

Hi,
does somebody know, how to disable the = auto-conversion of a 2-byte sequence of 0x0D 0x0A into a single byte = '\n'?
I want to process binary data, which = can contain such byte sequences but not idicating end-of-line as the = file has a fix record length.

Please take the example below:

# input file "test.dat" = contains 2 bytes: 0x0D and 0x0A
# the result file should contain 0x0A = 0x0D in this example

dest =3D File.new("test.dat", = "r")
a =3D dest.sysread(1) # should read 1 = byte (0x0D), but does read both in reality as '\n'
b =3D dest.sysread(1) # should read 1 = byte (0x0A), but gets EOF/nil in consequence of above
dest.close

dest =3D = File.new("result.dat", "w")
dest.syswrite(b)
dest.syswrite(a)
dest.close

Best regards,
Frank

------_=_NextPart_001_01C329BE.86992AEC-- ------=_NextPartTM-000-e6b0f9cb-19c9-4173-a238-8f9323ea92fc--