Mail Archives: djgpp/2000/07/24/10:01:12
Jim Smith <jsmith AT ethernet DOT com> wrote:
: I just installed the latest djgpp C compiler on my Windows 98 machine,
: and I cannot make this simple program work correctly. It is supposed
: to simply open a file and write out 5 bytes. It does work correctly
: (without any changes) on Linux. The Windows version always inserts a
: 0x0d before every 0x0a. On Windows my output file ("junkfile") has a
: total of 7 bytes ( two 0x0d bytes added), but on Linux my output file
: has a total of 5 bytes, as expected.
Welcome to the wonderfull world of DOS CR/LF linebreaks.
If you write out a text file on dos, you will get those CR/LF endings.
Open with O_BINARY to circumvent.
Bye
--
Uwe Bonnes bon AT elektron DOT ikp DOT physik DOT tu-darmstadt DOT de
Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
- Raw text -