home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a120 / 1.ddi / WATCOM_C / WAT117.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-08  |  938 b   |  37 lines

  1. /*------------------------------------------------------------------*/
  2. /* ╡{ªí└╔ªW║┘: wat117.c                                             */
  3. /*------------------------------------------------------------------*/
  4. #include <sys\stat.h>
  5. #include <string.h>
  6. #include <stdio.h>
  7. #include <fcntl.h>
  8. #include <io.h>
  9.  
  10. void main()
  11. {
  12.    int handle;
  13.    char data1[] = "FoxPro 2.0 └│Ñ╬╡{ªí¼╔¡▒ API---by Alex Jang\n";
  14.    char data2[] = "(╗P C ñ╬ Assembly ñº│s╡▓)";
  15.    char buf;
  16.  
  17.    /* ½╪Ñ▀ñ@¡╙└╔«╫ */
  18.    handle = open("MYFILE.$$$", O_CREAT | O_RDWR, S_IREAD | S_IWRITE);
  19.  
  20.    /* ▒N╕Ω«╞╝gñJ└╔«╫ññ */
  21.    write(handle, data1, strlen(data1));
  22.    write(handle, data2, strlen(data2));
  23.  
  24.    /* ▒N└╔«╫½ⁿ╝╨▓╛ª▄└╔«╫¬║╢}└Y│B */
  25.    lseek(handle, 0L, SEEK_SET);
  26.  
  27.    /* ▒q└╔«╫ññ┼¬¿·ªrñ╕¬╜¿∞ EOF ¼░ñε */
  28.    while (!eof(handle))
  29.    {
  30.       read(handle, &buf, 1);
  31.       printf("%c", buf);
  32.    }
  33.  
  34.    /* ├÷│¼└╔«╫ */
  35.    close(handle);
  36. }
  37.