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

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