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

version» Context lines:

pike.git/src/modules/_Stdio/file.c:1505:    *! has been updated.    *! @endint    *!    *! @seealso    *! @[errno()], @[read()]    *!    *! @note    *! The function may be interrupted prematurely    *! of the timeout (due to signals);    *! check the timing manually if this is imporant. -  *! -  *! @note -  *! The @[not_eof] parameter was added in Pike 7.7. -  *! -  *! @note -  *! This function was not available on NT in Pike 7.6 and earlier. +     */   static void file_peek(INT32 args)   {    int ret;    int not_eof = 0;    FLOAT_TYPE tf = 0.0;       get_all_args("peek",args,".%F%d",&tf,&not_eof);       {
pike.git/src/modules/_Stdio/file.c:1639:    *! problem persists then a later call to @[read_oob()] fails and    *! returns zero, however.    *!    *! If everything went fine, a call to @[errno()] directly afterwards    *! returns zero. That includes an end due to remote close.    *!    *! If no arguments are given, @[read_oob()] reads to the end of the    *! stream.    *!    *! @note -  *! Out-of-band data was not supported in Pike 0.5 and earlier, and -  *! not in Pike 0.6 through 7.4 if they were compiled with the -  *! option @tt{'--without-oob'@}. -  *! -  *! @note +     *! It is not guaranteed that all out-of-band data sent from the    *! other end is received. Most streams only allow for a single byte    *! of out-of-band data at a time.    *!    *! @note    *! It's not necessary to set @[not_all] to avoid blocking reading    *! when nonblocking mode is used.    *!    *! @note    *! When at the end of a file or stream, repeated calls to @[read()]
pike.git/src/modules/_Stdio/file.c:2195:    *! persists, then a later call to @[write_oob()] fails and returns    *! -1.    *!    *! If everything went fine, a call to @[errno()] directly afterwards    *! returns zero.    *!    *! If more than one argument is given, @[sprintf()] is used to format    *! them.    *!    *! @note -  *! Out-of-band data was not supported in Pike 0.5 and earlier, and -  *! not in Pike 0.6 through 7.4 if they were compiled with the -  *! option @tt{'--without-oob'@}. -  *! -  *! @note +     *! It is not guaranteed that all out-of-band data sent from the    *! other end is received. Most streams only allow for a single byte    *! of out-of-band data at a time. Some streams sends the rest of    *! the data as ordinary data.    *!    *! @seealso    *! @[read_oob()], @[write()]    */   static void file_write_oob(INT32 args)   {
pike.git/src/modules/_Stdio/file.c:2856: Inside #if defined(HAVE_OPENAT)
  #ifdef HAVE_OPENAT   /*! @decl Stdio.File openat(string filename, string mode)    *! @decl Stdio.File openat(string filename, string mode, int access)    *!    *! Open a file relative to an opened directory.    *!    *! @returns    *! Returns a new file object on success, and @expr{0@} (zero) on failure.    *!    *! @note -  *! Not available on all architectures, or in Pike 7.6 and earlier. +  *! Not available on all architectures.    *!    *! @seealso    *! @[open()], @[statat()], @[unlinkat()]    */   static void file_openat(INT32 args)   {    int flags, fd, dir_fd;    int access = 00666;    int err;    struct pike_string *str, *flag_str;
pike.git/src/modules/_Stdio/file.c:3346:    *! Get status for an open file.    *!    *! This function returns the same information as the function    *! @[file_stat()], but for the file it is called in. If file is not    *! an open file, @expr{0@} (zero) is returned. Zero is also returned    *! if file is a pipe or socket.    *!    *! @returns    *! See @[file_stat()] for a description of the return value.    *! -  *! @note -  *! Prior to Pike 7.1 this function returned an array(int). -  *! +     *! @seealso    *! @[file_stat()], @[statat()]    */   static void file_stat(INT32 args)   {    int fd;    PIKE_STAT_T s;    int tmp;       if(FD < 0)
pike.git/src/modules/_Stdio/file.c:3399: Inside #if defined(HAVE_FSTATAT)
   *!    *! This function returns the same information as the function    *! @[file_stat()], but relative to the file it is called in. If file is not    *! an open file, @expr{0@} (zero) is returned. Zero is also returned    *! if file is a pipe or socket.    *!    *! @returns    *! See @[file_stat()] for a description of the return value.    *!    *! @note -  *! Not available on all architectures, or in Pike 7.6 and earlier. +  *! Not available on all architectures.    *!    *! @seealso    *! @[file_stat()], @[stat()], @[openat()], @[unlinkat()]    */   static void file_statat(INT32 args)   {    int fd;    PIKE_STAT_T s;    int tmp;    struct pike_string *path;
pike.git/src/modules/_Stdio/file.c:3520: Inside #if defined(HAVE_FDOPENDIR) && defined(HAVE_OPENAT)
   *! Get directory contents relative to an open directory.    *!    *! @param path    *! Path relative to the open directory. Defaults to the    *! directory itself.    *!    *! @returns    *! Returns an array of filenames.    *!    *! @note -  *! Not available on all architectures, or in Pike 7.6 and earlier. +  *! Not available on all architectures.    *!    *! @seealso    *! @[predef::get_dir()], @[statat()], @[openat()], @[unlinkat()]    */   static void file_get_dir(INT32 args)   {    int fd;    int dfd;    struct pike_string *path = NULL;    ptrdiff_t name_max = -1;
pike.git/src/modules/_Stdio/file.c:3856:    *! @[PROP_BUFFERED]    *! @value 0x0004    *! @[PROP_SHUTDOWN]    *! @value 0x0002    *! @[PROP_NONBLOCK]    *! @value 0x0001    *! @[PROP_IPC]    *! @endint    *!    *! @note -  *! In some versions of Pike 7.7 and 7.8 the @tt{PROP_@} flags were +  *! In some versions of Pike 7.8 the @tt{PROP_@} flags were    *! filtered from the result.    *!    *! @seealso    *! @[open()]    */   static void file_mode(INT32 args)   {    pop_n_elems(args);    push_int(THIS->open_mode);   }
pike.git/src/modules/_Stdio/file.c:4701:    *! Duplicate a file over another.    *!    *! This function works similarly to @[assign()], but instead of making    *! the argument a reference to the same file, it creates a new file    *! with the same properties and places it in the argument.    *!    *! @returns    *! Returns @expr{1@} on success and @expr{0@} (zero) on failure.    *!    *! @note -  *! In Pike 7.7 and later @[to] need not be open, in which +  *! @[to] need not be open, in which    *! case a new fd is allocated.    *!    *! @note    *! Note also that @[to] is also assigned to the same backend (if any)    *! as this object.    *!    *! @seealso    *! @[assign()], @[dup()]    */   static void file_dup2(INT32 args)