pike.git / src / modules / _Stdio / file.c

version» Context lines:

pike.git/src/modules/_Stdio/file.c:1691:   #endif       SUB_FD_EVENTS (f, ~0);   }         /*! @decl int write(string data)    *! @decl int write(string format, mixed ... extras)    *! @decl int write(array(string) data)    *! @decl int write(array(string) format, mixed ... extras) +  *! @decl int write(Stdio.Buffer|String.Buffer|System.Memory data, void|int(0..) offset)    *!    *! Write data to a file or a stream.    *!    *! If there are any file descriptors that have been queued for sending    *! (with @[send_fd()]), they will be sent.    *!    *! @param data    *! Data to write.    *!    *! If @[data] is an array of strings, they are written in sequence.    *!    *! @param format    *! @param extras    *! If more than one argument is given, @[sprintf()] is used to format    *! them using @[format]. If @[format] is an array, the strings in it    *! are concatenated and the result is used as format string.    *! -  +  *! @param offset +  *! The offset in data to start writing from. +  *!    *! @returns    *! Writes @[data] and returns the number of bytes that were    *! actually written.    *!    *! @int    *! @value 1..    *! The number of bytes successfully written to the OS buffers.    *!    *! This can be less than the size of the given data if eg:    *! @ul
pike.git/src/modules/_Stdio/file.c:1754:    *! @endint    *!    *! If everything went fine, a call to @[errno()] directly afterwards    *! returns zero.    *!    *! @note    *! Writing of wide strings is not supported. You have to encode the    *! data somehow, e.g. with @[string_to_utf8] or with one of the    *! charsets supported by @[Charset.encoder].    *! +  *! @note +  *! The variant of this function using a buffer object does not release +  *! the interpreter lock. +  *!    *! @seealso    *! @[read()], @[write_oob()], @[send_fd()]    */   #ifdef HAVE_WRITEV   static ptrdiff_t file_write_array(struct array *a)   {    ptrdiff_t written, i;       i = a->size;    while(i--)