home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mntdoc01.zoo / mintdoc / cat3 / write.3 < prev   
Encoding:
Text File  |  1993-03-03  |  1.7 KB  |  67 lines

  1.  
  2.  
  3.  
  4. WRITE(3)            MINTLIB LIBRARY FUNCTIONS            WRITE(3)
  5.  
  6.  
  7. N✓NA✓AM✓ME✓E
  8.        write - write on a file
  9.  
  10. S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
  11.        #include <unistd.h>
  12.  
  13.        int write(int fildes, const void *buf, unsigned nbyte);
  14.  
  15. D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
  16.        fildes  is  a file descriptor obtained from a creat, open,
  17.        dup, fcntl, or pipe system call.
  18.  
  19.        write attempts  to  write  nbyte  bytes  from  the  buffer
  20.        pointed to by buf to the file associated with fildes.
  21.  
  22.        When fildes indicates a device, writing always takes place
  23.        at the current position. When fildes indicates a file, the
  24.        actual  writing  of data proceeds from the position in the
  25.        file indicated by  the  file  pointer.  Upon  return  from
  26.        write,  the  file  pointer is incremented by the number of
  27.        bytes actually written.  If the O_APPEND flag of the  file
  28.        status  flags  is set, the file pointer will be set to the
  29.        end of the file prior to writing.
  30.  
  31.  
  32. R✓RE✓ET✓TU✓UR✓RN✓N V✓VA✓AL✓LU✓UE✓ES✓S
  33.        Upon successful completion the number  of  bytes  actually
  34.        written  is  returned. Otherwise, -1 is returned and errno
  35.        is set to indicate the error.
  36.  
  37. N✓NO✓OT✓TE✓E
  38.        The underlying call, Fwrite, takes a long nbyte  parameter
  39.        and  returns  a  long result. This means that, when 16-bit
  40.        integers are used, Fwrite can write over 64 Kb at  a  time
  41.        while write cannot.
  42.  
  43. S✓SE✓EE✓E A✓AL✓LS✓SO✓O
  44.        c✓cr✓re✓ea✓at✓t(✓(3✓3)✓),✓,  d✓du✓up✓p(✓(3✓3)✓),✓,  f✓fc✓cn✓nt✓tl✓l(✓(3✓3)✓),✓,  l✓ls✓se✓ee✓ek✓k(✓(3✓3)✓),✓, o✓op✓pe✓en✓n(✓(3✓3)✓),✓, p✓pi✓ip✓pe✓e(✓(3✓3)✓),✓,
  45.        F✓Fw✓wr✓ri✓it✓te✓e(✓(2✓2)✓)
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. MiNT docs 0.1              3 March 1993                         1
  65.  
  66.  
  67.