Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

apr_file_io.h File Reference

APR File I/O Handling. More...

#include "apr.h"
#include "apr_pools.h"
#include "apr_time.h"
#include "apr_errno.h"
#include "apr_file_info.h"
#include "apr_inherit.h"
#include "apr_want.h"

Go to the source code of this file.

Defines

#define APR_WANT_STDIO
#define APR_WANT_IOVEC
#define APR_READ   0x00001
#define APR_WRITE   0x00002
#define APR_CREATE   0x00004
#define APR_APPEND   0x00008
#define APR_TRUNCATE   0x00010
#define APR_BINARY   0x00020
#define APR_EXCL   0x00040
#define APR_BUFFERED   0x00080
#define APR_DELONCLOSE   0x00100
#define APR_XTHREAD   0x00200
#define APR_SHARELOCK   0x00400
#define APR_FILE_NOCLEANUP   0x00800
#define APR_SENDFILE_ENABLED   0x01000
#define APR_LARGEFILE   0x04000
#define APR_SET   SEEK_SET
#define APR_CUR   SEEK_CUR
#define APR_END   SEEK_END
#define APR_FILE_ATTR_READONLY   0x01
#define APR_FILE_ATTR_EXECUTABLE   0x02
#define APR_FILE_ATTR_HIDDEN   0x04
#define APR_FLOCK_SHARED   1
#define APR_FLOCK_EXCLUSIVE   2
#define APR_FLOCK_TYPEMASK   0x000F
#define APR_FLOCK_NONBLOCK   0x0010

Typedefs

typedef apr_uint32_t apr_fileattrs_t
typedef int apr_seek_where_t
typedef apr_file_t apr_file_t

Functions

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)
apr_status_t apr_file_close (apr_file_t *file)
apr_status_t apr_file_remove (const char *path, apr_pool_t *cont)
apr_status_t apr_file_rename (const char *from_path, const char *to_path, apr_pool_t *pool)
apr_status_t apr_file_copy (const char *from_path, const char *to_path, apr_fileperms_t perms, apr_pool_t *pool)
apr_status_t apr_file_append (const char *from_path, const char *to_path, apr_fileperms_t perms, apr_pool_t *pool)
apr_status_t apr_file_eof (apr_file_t *fptr)
apr_status_t apr_file_open_stderr (apr_file_t **thefile, apr_pool_t *cont)
apr_status_t apr_file_open_stdout (apr_file_t **thefile, apr_pool_t *cont)
apr_status_t apr_file_open_stdin (apr_file_t **thefile, apr_pool_t *cont)
apr_status_t apr_file_read (apr_file_t *thefile, void *buf, apr_size_t *nbytes)
apr_status_t apr_file_write (apr_file_t *thefile, const void *buf, apr_size_t *nbytes)
apr_status_t apr_file_writev (apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes)
apr_status_t apr_file_read_full (apr_file_t *thefile, void *buf, apr_size_t nbytes, apr_size_t *bytes_read)
apr_status_t apr_file_write_full (apr_file_t *thefile, const void *buf, apr_size_t nbytes, apr_size_t *bytes_written)
apr_status_t apr_file_putc (char ch, apr_file_t *thefile)
apr_status_t apr_file_getc (char *ch, apr_file_t *thefile)
apr_status_t apr_file_ungetc (char ch, apr_file_t *thefile)
apr_status_t apr_file_gets (char *str, int len, apr_file_t *thefile)
apr_status_t apr_file_puts (const char *str, apr_file_t *thefile)
apr_status_t apr_file_flush (apr_file_t *thefile)
apr_status_t apr_file_dup (apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p)
apr_status_t apr_file_dup2 (apr_file_t *new_file, apr_file_t *old_file, apr_pool_t *p)
apr_status_t apr_file_setaside (apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p)
apr_status_t apr_file_seek (apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset)
apr_status_t apr_file_pipe_create (apr_file_t **in, apr_file_t **out, apr_pool_t *cont)
apr_status_t apr_file_namedpipe_create (const char *filename, apr_fileperms_t perm, apr_pool_t *cont)
apr_status_t apr_file_pipe_timeout_get (apr_file_t *thepipe, apr_interval_time_t *timeout)
apr_status_t apr_file_pipe_timeout_set (apr_file_t *thepipe, apr_interval_time_t timeout)
apr_status_t apr_file_lock (apr_file_t *thefile, int type)
apr_status_t apr_file_unlock (apr_file_t *thefile)
apr_status_t apr_file_name_get (const char **new_path, apr_file_t *thefile)
apr_status_t apr_file_data_get (void **data, const char *key, apr_file_t *file)
apr_status_t apr_file_data_set (apr_file_t *file, void *data, const char *key, apr_status_t(*cleanup)(void *))
int apr_file_printf (apr_file_t *fptr, const char *format,...)
apr_status_t apr_file_perms_set (const char *fname, apr_fileperms_t perms)
apr_status_t apr_file_attrs_set (const char *fname, apr_fileattrs_t attributes, apr_fileattrs_t attr_mask, apr_pool_t *cont)
apr_status_t apr_file_mtime_set (const char *fname, apr_time_t mtime, apr_pool_t *pool)
apr_status_t apr_dir_make (const char *path, apr_fileperms_t perm, apr_pool_t *cont)
apr_status_t apr_dir_make_recursive (const char *path, apr_fileperms_t perm, apr_pool_t *pool)
apr_status_t apr_dir_remove (const char *path, apr_pool_t *cont)
apr_status_t apr_file_info_get (apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile)
apr_status_t apr_file_trunc (apr_file_t *fp, apr_off_t offset)
apr_int32_t apr_file_flags_get (apr_file_t *f)
apr_pool_tapr_file_pool_get (const apr_file_t *thefile)
apr_status_t apr_file_inherit_set (apr_file_t *thefile)
void apr_file_set_inherit (apr_file_t *file)
apr_status_t apr_file_inherit_unset (apr_file_t *thefile)
void apr_file_unset_inherit (apr_file_t *file)
apr_status_t apr_file_mktemp (apr_file_t **fp, char *templ, apr_int32_t flags, apr_pool_t *p)
apr_status_t apr_temp_dir_get (const char **temp_dir, apr_pool_t *p)


Detailed Description

APR File I/O Handling.


Define Documentation

#define APR_WANT_IOVEC
 

for apr_file_writev

#define APR_WANT_STDIO
 

for SEEK_*


Typedef Documentation

typedef apr_uint32_t apr_fileattrs_t
 

File attributes


Function Documentation

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
 

Open the specified file.

Parameters:
newf The opened file descriptor.
fname The full path to the file (using / on all systems)
flag Or'ed value of:
         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 cont 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_sendfile does not check this flag.
 
perm Access permissions for file.
pool The pool to use.
Remarks:
If perm is APR_OS_DEFAULT and the file is being created, appropriate default permissions will be used. *arg1 must point to a valid file_t, or NULL (in which case it will be allocated)


Generated on Wed Nov 23 04:20:21 2005 for Apache Portable Runtime by  doxygen 1.4.4