Date: Tue, 30 Nov 93 11:13:34 +0100 From: hmuelner AT fiicmds03 DOT tu-graz DOT ac DOT at To: dj AT ctron DOT com Cc: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Re: O_BINARY >>>>> "DJ" == DJ Delorie writes: >> I would like to suggest a method similar to that used by Borland: >> To have a global variable _fmode with the two values O_BINARY >> (perhaps default) and O_TEXT which controls CR/LF translation. DJ> Such a variable already exists, and functions as you describe. DJ> The default, as in Borland C, is O_TEXT. 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? >> 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. >> Another great help for porting unix programs would be a possibility >> to detect (e.g. warning to stderr or similar) opens with filenames >> longer than 8+3 characters. DJ> This would cause output on most programs. Even DOS does not DJ> detect or warn about this. 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. 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. Cheers, Helmut Muelner (GNU and DJGPP fan, MSDOS hater)