apr_file_io.h


※上記の広告は60日以上更新のないWIKIに表示されています。更新することで広告が下部へ移動します。

/**
* Open the specified file.
* @param newf The opened file descriptor.
* @param fname The full path to the file (using / on all systems)
* @param flag Or'ed value of:
* <PRE>
*         APR_READ              open for reading
*         APR_WRITE             open for writing
*         APR_CREATE            create the file if not there
*         APR_APPEND            file ptr is set to end prior to all writes
*         APR_TRUNCATE          set length to zero if file exists
*         APR_BINARY            not a text file (This flag is ignored on 
*                               UNIX because it has no meaning)
*         APR_BUFFERED          buffer the data.  Default is non-buffered
*         APR_EXCL              return error if APR_CREATE and file exists
*         APR_DELONCLOSE        delete the file after closing.
*         APR_XTHREAD           Platform dependent tag to open the file
*                               for use across multiple threads
*         APR_SHARELOCK         Platform dependent support for higher
*                               level locked read/write access to support
*                               writes across process/machines
*         APR_FILE_NOCLEANUP    Do not register a cleanup with the pool 
*                               passed in on the <EM>pool</EM> argument (see below).
*                               The apr_os_file_t handle in apr_file_t will not
*                               be closed when the pool is destroyed.
*         APR_SENDFILE_ENABLED  Open with appropriate platform semantics
*                               for sendfile operations.  Advisory only,
*                               apr_socket_sendfile does not check this flag.
* </PRE>
* @param perm Access permissions for file.
* @param pool The pool to use.
* @remark If perm is APR_OS_DEFAULT and the file is being created,
* appropriate default permissions will be used.
* @remark By default, the returned file descriptor will not be
* inherited by child processes created by apr_proc_create().  This
* can be changed using apr_file_inherit_set().
 */

APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **newf, const char *fname,
                                       apr_int32_t flag, apr_fileperms_t perm,
                                       apr_pool_t *pool);