home *** CD-ROM | disk | FTP | other *** search
- /*------------------------------------------------------------------*/
- /* ╡{ªí└╔ªW║┘: wat190.c */
- /*------------------------------------------------------------------*/
- #include <string.h>
- #include <stdio.h>
- #include <fcntl.h>
- #include <io.h>
- #include <sys\stat.h>
-
- void main()
- {
- int handle;
- char msg[9][49] = {"┴┘░O▒oºA│╠½ßñ@ª╕╣∩º┌╗í ⌐┌╡┤º┌¿Sª│Ñ⌠ª≤▓zÑ╤ \n",
- "┼╕º▌¬║ñΓñúñº▒N╢╦ñ▀ѵ╡╣╜╓ ├°¿∞╖R┤N¼O┼²ºA│o╝╦ªa¿½ \n",
- "ªhñ╓ª╕╖Qªb╕úññ▒NºA½°Ñh ⌐╥ª│░O╗⌡╕╠Ñ■│ú¼OºA \n",
- "ªp¬Gº┌»αªAñ@ª╕ª√╗ΓºA¬║ñ▀ ñú╖|╗┤⌐÷ªa╣²░h┼²ºA¿½ \n",
- "╖|Ñ╬º┌¬║ñ▀ºo│█╣∩ºA╗í \n",
- "º∩┼▄⌐╥ª│¬║┐∙ ┼²º┌▒q└Y╖R╣L \n",
- "º∩┼▄⌐╥ª│¬║┐∙ ªA┐∙ñ]ñúª^└Y \n",
- "º∩┼▄⌐╥ª│¬║┐∙ ┤N¼Oº┌¬║⌐╙┐╒ \n",
- "Ñu¡n»αªAª│ñ@ª╕╛≈╖| ▒Nñ@Ñ═╖P░╩Ñ■│í┼²ºA╛╓ª│ \n"};
- char buf;
- int i;
-
- if ((handle = open("TEST.TXT", O_RDWR | O_CREAT | O_TRUNC | O_TEXT ,
- S_IREAD | S_IWRITE )) == -1)
-
- {
- printf("╡L¬k╢}▒╥⌐╬½╪Ñ▀└╔«╫\n");
- exit(1);
- }
- for (i=0;i<9;i++)
- {
- write(handle, msg[i],49);
- printf("└╔«╫½ⁿ╝╨Ñ╪½eñºª∞╕mªb▓─ %4ld ¡╙ª∞ñ╕▓╒\n", tell(handle));
- }
-
- /* ▒N└╔«╫½ⁿ╝╨▓╛ª▄└╔«╫¬║╢}└Y│B */
- lseek(handle, 0L, SEEK_SET);
- printf("└╔«╫½ⁿ╝╨Ñ╪½eñºª∞╕mªb▓─ %4ld ¡╙ª∞ñ╕▓╒\n", tell(handle));
- printf("\n");
-
- printf("└╔«╫ñºñ║«e¼░: \n");
- /* ▒q└╔«╫ññ┼¬¿·ªrñ╕¬╜¿∞ EOF ¼░ñε */
- while (!eof(handle))
- {
- read(handle, &buf, 1);
- printf("%c", buf);
- }
- printf("\n");
- printf("└╔«╫½ⁿ╝╨Ñ╪½eñºª∞╕mªb▓─ %4ld ¡╙ª∞ñ╕▓╒\n", tell(handle));
- /* ├÷│¼└╔«╫ */
- close(handle);
- }