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

  1. /*------------------------------------------------------------------*/
  2. /* ╡{ªí└╔ªW║┘: wat27.c                                              */
  3. /*------------------------------------------------------------------*/
  4. #include <string.h>
  5. #include <fcntl.h>
  6. #include <sys\stat.h>
  7. #include <io.h>
  8.  
  9. void main()
  10. {
  11.    int handle;
  12.    char buffer[20] = "0123456789ABCDEFGHIJ";
  13.  
  14.    /* ½╪Ñ▀ñ@¡╙ñjñp¼░ 20 ¡╙ª∞ñ╕▓╒¬║└╔«╫ */
  15.    handle = open("MYFILE.TXT", O_RDWR|O_CREAT|O_TRUNC, S_IREAD|S_IWRITE);
  16.    write(handle, buffer, strlen(buffer));
  17.  
  18.    /* ▒N└╔«╫╝W¬°ª▄ 512 ¡╙ª∞ñ╕▓╒ */
  19.    if(chsize(handle, 512) == 0)
  20.    {
  21.       printf("└╔«╫ñw│Q╝W¬°ª▄ 512 ¡╙ª∞ñ╕▓╒\n");
  22.    }
  23.    else
  24.    {
  25.       printf("╡L¬k╝W¬°└╔«╫\n");
  26.    }
  27.  
  28.    /* ├÷│¼└╔«╫ */
  29.    close(handle);
  30. }
  31.