www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/11/30/10:35:37

Date: Tue, 30 Nov 93 09:48:00 -0500
From: DJ Delorie <dj AT ctron DOT com>
To: hmuelner AT fiicmds03 DOT tu-graz DOT ac DOT at
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: O_BINARY

> Oh, I did not find that in the documentation ;-)
> Where can I change the default to O_BINARY? Does it also work for
> stdin/stdout?

setmode() works for stdin/stdout (I hope).  1.11 will include
documentation.

> >> And there should be an environment (or go32) variable to initialize
> >> it.

> DJ> No.  This would globally affect all programs.

> But only if you set it.

If you set O_BINARY, gcc doesn't work.

> I recently ported the pbm utilities and the GNU text utilities to
> DJGPP.  I was frustrated by all the unnecessary editing. Most of my
> text files and all my pbm files do not contain CRs (SET FMODE=BINARY),
> but sometimes I need CR-LF translation (e.g. head, if stdout is the
> console, but not if it is a file). With an environment variable (or
> perhaos two for input and output?) I could change the behavior without
> recompiling.

Such programs should use fopen(...,"rb") to be ANSI compliant anyway.

> Several months ago I got a compiled version of GNU sort that did not
> work for big files, because it generated tempfiles with
> "temp%5d%5d" using pid and a serial number. A debugging facility to
> inform about filename length overflow would have shown the error
> immediately.

This is an MS-DOS problem, not a djgpp problem.  Neither Borland nor
Microsoft have a way of helping here, just as djgpp does not.  If
you'd like to write a special version of open() that users could link
in as desired, you may - It's better to have the first person that
ports a program send diffs back to the maintainer so that nobody has
this problem any more.


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019