Mail Archives: djgpp/1994/06/21/17:02:20
marty (leisner AT sdsp DOT mc DOT xerox DOT com) wrote:
> Recompiling the gnu fileutils, I needed to stick this
> in the fileutils lib (or else have to change every open call
> everywhere or change __fmode in each main...):
>
> .data
> .globl __fmode
> __fmode:
> -> .long 0x000 ; changes from O_TEXTMODE
>
> .text
> .globl _open
> _open:
> testl $0xc000,8(%esp)
> jnz L0
> andl $0xc000,__fmode
> movl __fmode,%eax
> orl %eax,8(%esp)
> L0:
> movb $2,%al
> jmp turbo_assist
>
> I really think the default mode should be binary "unless you need to
> do something special".
But that was the reasoning behind making text mode the default. And
whether you like it or not, text mode is the de facto standard for all
DOS compilers, not just djgpp. And text mode is the standard for
fopen(); you have to explicitly ask for binary mode.
--
Eric Backus
ericb AT lsid DOT hp DOT com
(206) 335-2495
- Raw text -