home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a120 / 1.ddi / WATCOM_C / TEST.C next >
Encoding:
C/C++ Source or Header  |  1992-05-20  |  829 b   |  33 lines

  1. /*------------------------------------------------------------------*/
  2. /* ╡{ªí└╔ªW║┘: wat142.c                                             */
  3. /*------------------------------------------------------------------*/
  4. #include <stdio.h>
  5. #include <dos.h>
  6. #include <fcntl.h>
  7.  
  8. void main()
  9. {
  10.    char *data="º╓╝╓¿∞⌐│¼Oñ░╗≥¬FªΦ !\nº╓╝╓┤N¼O╛╟▓▀ FoxPro..(ñ╙░╢ñjñF, ░_Ñ▀╣¬┤x)";
  11.    int handle;
  12.    unsigned len_read;
  13.    char buf[512];
  14.  
  15.    if (_dos_open("TEST.TXT", O_RDONLY, &handle) != 0)
  16.    {
  17.       printf("╢}└╔┐∙╗~\n");
  18.       exit(1);
  19.    }
  20.  
  21.    write(handle, data, strlen(data));
  22.    lseek(handle, 0L, SEEK_SET);
  23.    if ((bytes = _dos_read(handle, buf, strlen(data), &len_read)) != 0)
  24.    {
  25.         printf("┼¬¿·Ñó▒╤.\n");
  26.         exit(1);
  27.    }
  28.    else
  29.    {
  30.       printf("ª@┼¬¿· %d ¡╙ª∞ñ╕▓╒.\n", len_read);
  31.    }
  32. }
  33.