home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a120 / 1.ddi / WATCOM_C / WAT190.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-18  |  1.8 KB  |  55 lines

  1. /*------------------------------------------------------------------*/
  2. /* ╡{ªí└╔ªW║┘: wat190.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 msg[9][49] = {"┴┘░O▒oºA│╠½ßñ@ª╕╣∩º┌╗í ⌐┌╡┤º┌¿Sª│Ñ⌠ª≤▓zÑ╤       \n",
  14.                       "┼╕º▌¬║ñΓñúñº▒N╢╦ñ▀ѵ╡╣╜╓ ├°¿∞╖R┤N¼O┼²ºA│o╝╦ªa¿½ \n",
  15.                       "ªhñ╓ª╕╖Qªb╕úññ▒NºA½°Ñh ⌐╥ª│░O╗⌡╕╠Ñ■│ú¼OºA       \n",
  16.                       "ªp¬Gº┌»αªAñ@ª╕ª√╗ΓºA¬║ñ▀ ñú╖|╗┤⌐÷ªa╣²░h┼²ºA¿½   \n",
  17.                       "╖|Ñ╬º┌¬║ñ▀ºo│█╣∩ºA╗í                            \n",
  18.                       "º∩┼▄⌐╥ª│¬║┐∙ ┼²º┌▒q└Y╖R╣L                       \n",
  19.                       "º∩┼▄⌐╥ª│¬║┐∙ ªA┐∙ñ]ñúª^└Y                       \n",
  20.                       "º∩┼▄⌐╥ª│¬║┐∙ ┤N¼Oº┌¬║⌐╙┐╒                       \n",
  21.                       "Ñu¡n»αªAª│ñ@ª╕╛≈╖| ▒Nñ@Ñ═╖P░╩Ñ■│í┼²ºA╛╓ª│       \n"};
  22.    char buf;
  23.    int i;
  24.  
  25.    if ((handle = open("TEST.TXT", O_RDWR | O_CREAT | O_TRUNC | O_TEXT ,
  26.                        S_IREAD | S_IWRITE )) == -1)
  27.  
  28.    {
  29.       printf("╡L¬k╢}▒╥⌐╬½╪Ñ▀└╔«╫\n");
  30.       exit(1);
  31.    }
  32.    for (i=0;i<9;i++)
  33.    {
  34.         write(handle, msg[i],49);
  35.         printf("└╔«╫½ⁿ╝╨Ñ╪½eñºª∞╕mªb▓─ %4ld ¡╙ª∞ñ╕▓╒\n", tell(handle));
  36.    }
  37.  
  38.    /* ▒N└╔«╫½ⁿ╝╨▓╛ª▄└╔«╫¬║╢}└Y│B */
  39.    lseek(handle, 0L, SEEK_SET);
  40.    printf("└╔«╫½ⁿ╝╨Ñ╪½eñºª∞╕mªb▓─ %4ld ¡╙ª∞ñ╕▓╒\n", tell(handle));
  41.    printf("\n");
  42.  
  43.    printf("└╔«╫ñºñ║«e¼░: \n");
  44.    /* ▒q└╔«╫ññ┼¬¿·ªrñ╕¬╜¿∞ EOF ¼░ñε */
  45.    while (!eof(handle))
  46.    {
  47.       read(handle, &buf, 1);
  48.       printf("%c", buf);
  49.    }
  50.    printf("\n");
  51.    printf("└╔«╫½ⁿ╝╨Ñ╪½eñºª∞╕mªb▓─ %4ld ¡╙ª∞ñ╕▓╒\n", tell(handle));
  52.    /* ├÷│¼└╔«╫ */
  53.    close(handle);
  54. }
  55.