diff options
Diffstat (limited to 'winsup/mingw/samples/fmode/test2.c')
-rw-r--r-- | winsup/mingw/samples/fmode/test2.c | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/winsup/mingw/samples/fmode/test2.c b/winsup/mingw/samples/fmode/test2.c deleted file mode 100644 index b7d6b1891..000000000 --- a/winsup/mingw/samples/fmode/test2.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * A sample program demonstrating how to use fmode to change the default - * file opening mode to binary. Compare this file, which sets _fmode - * at file level to test.c, which sets the dll variable directly within - * main. - * NOTE: Does not change stdin, stdout or stderr. - * - * THIS CODE IS IN THE PUBLIC DOMAIN. - * - * Colin Peters <colin@fu.is.saga-u.ac.jp> - * Danny Smith <dannysmith@users.sourceforge.net> - */ - -#include <stdio.h> -#include <stdlib.h> /* _fmode */ -#include <fcntl.h> /* _O_BINARY */ - -#undef _fmode -int _fmode = _O_BINARY; - -main () -{ - - char* sz = "This is line one.\nThis is line two.\n"; - FILE* fp; - - printf (sz); - - /* Note how this fopen does NOT indicate "wb" to open the file in - * binary mode. */ - fp = fopen ("test2.out", "w"); - - fprintf (fp, sz); - - fclose (fp); -} - |