Posted-From: The MITRE Corporation, Bedford, MA To: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Re: creat doesn't use proper default filetype Date: Tue, 27 Jul 1993 07:54:44 -0400 From: "Daryl K. Baker" In his response michaels AT vsl DOT com DOT AU (Michael Snoswell) notes: >>gcc is meant to open files in binary mode by default, which is what unix all >>compilers do. Text mode is the default for DOS compilers :-) No, the djgpp docs clearly indicate the default is text mode. I can specify the default behavior of open with the _fmode global varable, create does not honor this flag and only creates binary files. A typical man page for creat says: This interface is made obsolete by open(2V), since, creat(path, mode); is equivalent to open(path, O_WRONLY | O_CREAT | O_TRUNC, mode); However in the source to the djgpp libraies creat is implemented by a call to an assembler routine. (I lost energy at this point to trace it any further). A revised creat.s could be changed to creat.c with the above call to open. Daryl dkb AT mitre DOT org