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

  1. /*------------------------------------------------------------------*/
  2. /* ╡{ªí└╔ªW║┘: wat34.c                                              */
  3. /*------------------------------------------------------------------*/
  4. #include <sys\stat.h>
  5. #include <string.h>
  6. #include <fcntl.h>
  7. #include <stdlib.h>
  8. #include <io.h>
  9.  
  10. void main()
  11. {
  12.    int handle;
  13.    char buffer[20] = "0123456789ABCDEFGHIJ";
  14.  
  15.    /* │]⌐w╣w│]ñº└╔«╫╝╥ªí¼░ñσªr└╔ */
  16.    _fmode = O_TEXT;
  17.  
  18.    /* ½╪Ñ▀ñ@¡╙Ñi┼¬ÑBÑi╝gñºñσªr└╔ MYFILE.TXT */
  19.    handle = creat("MYFILE.TXT", S_IREAD | S_IWRITE);
  20.    if(handle != -1)
  21.    {
  22.       /* ╝gñJ 20 ¡╙ª∞ñ╕▓╒ª▄ª╣└╔«╫ */
  23.       if(write(handle, buffer, strlen(buffer)) == 20)
  24.       {
  25.          printf("ñw½╪Ñ▀ñ@¡╙ 20 ¡╙ª∞ñ╕▓╒ñjñp, Ñi┼¬ÑBÑi╝gñºñσªr└╔ MYFILE.TXT\n");
  26.        }
  27.       else
  28.       {
  29.          printf("Ñ╝»αÑ┐▒`⌐╬º╣Ñ■╝gñJ\n");
  30.        }
  31.        /* ├÷│¼└╔«╫ */
  32.       close(handle);
  33.     }
  34.     else
  35.     {
  36.         printf("╢} └╔ ┐∙ ╗~\n");
  37.     }
  38. }
  39.