home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a120 / 1.ddi / WATCOM_C / WAT60.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-07-18  |  632 b   |  28 lines

  1. /*------------------------------------------------------------------*/
  2. /* ╡{ªí└╔ªW║┘: wat60.c                                              */
  3. /*------------------------------------------------------------------*/
  4. #include <sys\stat.h>
  5. #include <string.h>
  6. #include <fcntl.h>
  7. #include <io.h>
  8.  
  9. void main()
  10. {
  11.    #define STDOUT 1
  12.  
  13.    int nul, oldstdout;
  14.    char msg[] = "┤· ╕╒ Ñ╬";
  15.  
  16.    nul = open("TEST.TXT", O_CREAT | O_RDWR,
  17.       S_IREAD | S_IWRITE);
  18.  
  19.    oldstdout = dup(STDOUT);
  20.    dup2(nul, STDOUT);
  21.  
  22.    close(nul);
  23.  
  24.    write(STDOUT, msg, strlen(msg));
  25.    dup2(oldstdout, STDOUT);
  26.    close(oldstdout);
  27. }
  28.