Mail Archives: djgpp/1997/04/09/05:44:23
Sven G. wrote:
>
> At first I new to C. But I hope its not my fault.
> I wrote a simple program unter gcc/linux which runs ok. Then I compiled it with
> DJGPP V2 under MS-DOS but the prg made nonsense.
> As I debugged it, I saw that read (off a file) returned 0x3D instead of 0x40.
> It was in the middle of the file, and how I said it worked under linux.
> Maybe I did not considerated something I did not know.
DOS text files use a CR/LF combination to designate the end of a line,
while Unix text files use only a CR. Thus, DOS text files are larger
than the corresponding Unix file. For this reason, you should NEVER
open a text file in binary mode.
There are utilities in the DJGPP distribution called 'dtou' and 'utod'
that can convert between DOS and Unix style text files.
--
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I | mailto:fighteer AT cs DOT com |
| God's final message to His Creation: | http://www.cs.com/fighteer |
| "We apologize for the inconvenience."| Fight against proprietary |
| - Douglas Adams | software - support the FSF!|
---------------------------------------------------------------------
- Raw text -