Mail Archives: djgpp/1993/07/26/15:00:22
When porting a copy of apps that use creat I noticed that the files
opened were in "binary" mode instead of the default text mode.
This occurs using version 1.10 of go32 1.10, and gcc 2.4.1
--demo program --
#include <fcntl.h>
#include <string.h>
char *string = "this is a test\n second line\n";
main ()
{
int fd1;
int fd2;
fd1 = open ("t1", O_CREAT | O_WRONLY);
fd2 = creat ("t2", 0666);
write ( fd1, string, strlen(string));
write ( fd2, string, strlen(string));
}
-- output --
t1:
this is a test
second line
t2:
this is a test
second line
--- T1 and T2 should be the same.
- Raw text -