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

File I/O Handling Functions

Collaboration diagram for File I/O Handling Functions:


Modules

 File Open Flags/Routines
 File Seek Flags
 File Attribute Flags
 File Lock Types

Typedefs

typedef apr_uint32_t apr_fileattrs_t
typedef int apr_seek_where_t
typedef apr_file_t apr_file_t

Functions

 APR_DECLARE (apr_status_t) apr_file_open(apr_file_t **newf
 APR_DECLARE_NONSTD (int) apr_file_printf(apr_file_t *fptr
const char __attribute__ ((format(printf, 2, 3)))
 APR_DECLARE (apr_int32_t) apr_file_flags_get(apr_file_t *f)
 APR_POOL_DECLARE_ACCESSOR (file)
 APR_DECLARE_INHERIT_SET (file)
 APR_DECLARE (void) apr_file_set_inherit(apr_file_t *file)
 APR_DECLARE_INHERIT_UNSET (file)

Variables

const char * fname
const char apr_int32_t flag
const char apr_int32_t apr_fileperms_t perm
const char apr_int32_t apr_fileperms_t
apr_pool_t
pool
apr_pool_tcont
const char * to_path
const char apr_fileperms_t perms
void * buf
void apr_size_t * nbytes
const struct iovec * vec
const struct iovec apr_size_t nvec
void apr_size_t apr_size_t * bytes_read
const void apr_size_t apr_size_t * bytes_written
apr_file_tthefile
int len
apr_file_told_file
apr_file_t apr_pool_tp
apr_seek_where_t where
apr_seek_where_t apr_off_t * offset
apr_file_t ** out
apr_interval_time_ttimeout
int type
const char * key
const char apr_file_tfile
void * data
void const char apr_status_t(* cleanup )(void *))
const char * format
apr_fileattrs_t attributes
apr_fileattrs_t apr_fileattrs_t attr_mask
apr_time_t mtime
apr_int32_t wanted
char * templ
char apr_int32_t flags
int const char * buf
request_rec apr_off_t apr_size_t
apr_size_t * 
nbytes
request_rec apr_off_t offset

Typedef Documentation

typedef struct apr_file_t apr_file_t
 

Structure for referencing files.

Definition at line 123 of file apr_file_io.h.

typedef apr_uint32_t apr_fileattrs_t
 

File attributes

Definition at line 115 of file apr_file_io.h.

typedef int apr_seek_where_t
 

should be same as whence type in lseek, POSIX defines this as int

Definition at line 118 of file apr_file_io.h.


Function Documentation

const char __attribute__ (format(printf, 2, 3))   ) 
 

APR_DECLARE void   ) 
 

Register an other_child -- a child associated to its registered maintence callback. This callback is invoked when the process dies, is disconnected or disappears.

Parameters:
proc The child process to register.
maintenance maintenance is a function that is invoked with a reason and the data pointer passed here.
data Opaque context data passed to the maintenance function.
write_fd An fd that is probed for writing. If it is ever unwritable then the maintenance is invoked with reason OC_REASON_UNWRITABLE.
p The pool to use for allocating memory.
Bug:
write_fd duplicates the proc->out stream, it's really redundant and should be replaced in the APR 1.0 API with a bitflag of which proc->in/out/err handles should be health checked.

no platform currently tests the pipes health.

Definition at line 131 of file apr_pools.c.

APR_DECLARE apr_int32_t   ) 
 

Retrieve the flags that were passed into apr_file_open() when the file was opened.

Returns:
apr_int32_t the flags

Definition at line 29 of file unix/fileacc.c.

APR_DECLARE apr_status_t   ) 
 

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)

Definition at line 24 of file netware/dso.c.

APR_DECLARE_INHERIT_SET file   ) 
 

Set a file to be inherited by child processes.

APR_DECLARE_INHERIT_UNSET file   ) 
 

Unset a file from being inherited by child processes.

APR_DECLARE_NONSTD int   ) 
 

Write a string to a file using a printf format.

Parameters:
fptr The file to write to.
format The format string
... The values to substitute in the format string
Returns:
The number of bytes written

APR_POOL_DECLARE_ACCESSOR file   ) 
 

Get the pool used by the file.


Variable Documentation

apr_fileattrs_t apr_fileattrs_t attr_mask
 

Definition at line 634 of file apr_file_io.h.

apr_fileattrs_t attributes
 

Definition at line 634 of file apr_file_io.h.

Referenced by APR_DECLARE().

const char * buf
 

Definition at line 1383 of file apr_buckets.h.

Referenced by ap_buffered_log_writer(), AP_DECLARE(), ap_proxy_ftp_handler(), ap_proxy_http_process_response(), ap_proxy_http_request(), appendAttributeValue(), apr_assert_success(), apr_err(), apr_file_transfer_contents(), APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(), APR_OPTIONAL_FN_TYPE(), CaseFilterInFilter(), CaseFilterOutFilter(), check_status(), close_pipe(), CuAssertIntEquals(), CuAssertPtrEquals(), CuAssertPtrNotNull(), CuStringAppendFormat(), CuTestRun(), dav_fs_add_locknull_state(), dav_fs_format_locktoken(), dav_fs_insert_prop(), dav_fs_load_lock_record(), dav_fs_remove_lock(), dav_fs_remove_locknull_state(), deflate_out_filter(), discard_script_output(), do_emit_plain(), do_expand_cookie(), do_expand_env(), doContent(), drain_available_output(), dumpit(), ef_output_filter(), file_bucket_read(), flush_all_logs(), ftp_check_string(), fully_qualify_uri(), hook_uri2file(), initialize_secret(), int64_t_fmt(), log_script(), lookup_map_program(), magic_process(), magic_rsl_printf(), main(), off_t_fmt(), oops(), output_directories(), parse_network(), pid_t_fmt(), pipe_bucket_read(), PROXY_DECLARE(), read_write(), read_write_notimeout(), reduce_uri(), select_random_value_part(), serialize_table(), size_t_fmt(), snprintf_int64(), snprintf_underflow(), sock_read(), socket_bucket_read(), ssize_t_fmt(), ssl_expr_eval_func_file(), ssl_io_data_dump(), ssl_rand_choosenum(), ssl_scache_shmcb_init(), ssl_session_log(), ssl_util_readfilter(), ssl_var_lookup_ssl(), store_body(), storeEntityValue(), string_error(), test_badip_str(), test_badmask_str(), test_bigread(), test_conversion(), test_create_proc(), test_file_redir(), test_mod_neg(), test_pipe_writefull(), true_random(), try(), uint64_t_fmt(), uint64_t_hex_fmt(), util_ldap_post_config(), and vhost_alias_interpolate().

const void* buf
 

Definition at line 404 of file apr_file_io.h.

void apr_size_t apr_size_t* bytes_read
 

Definition at line 382 of file apr_file_io.h.

Referenced by APR_DECLARE(), and sock_read().

const void apr_size_t apr_size_t* bytes_written
 

Definition at line 404 of file apr_file_io.h.

Referenced by pass_data_to_filter(), and writev_it_all().

void apr_status_t(* cleanup
 

Definition at line 550 of file apr_pools.h.

Referenced by remove_url().

apr_pool_t* cont
 

Definition at line 675 of file apr_file_io.h.

void * data
 

Definition at line 549 of file apr_pools.h.

const char apr_file_t* file
 

Definition at line 577 of file apr_file_io.h.

const char apr_int32_t flag
 

Definition at line 182 of file apr_file_io.h.

Referenced by lookup_variable().

char apr_int32_t flags
 

Definition at line 740 of file apr_file_io.h.

const char* fname
 

Definition at line 182 of file apr_file_io.h.

apr_size_t const char * format
 

Definition at line 267 of file apr_strings.h.

Referenced by config_log_transaction(), and open_multi_logs().

void const char* key
 

Definition at line 587 of file apr_file_io.h.

int len
 

Definition at line 436 of file apr_file_io.h.

apr_time_t mtime
 

Definition at line 647 of file apr_file_io.h.

const void apr_size_t nbytes
 

Definition at line 404 of file apr_file_io.h.

Referenced by AP_DECLARE(), ap_proxy_connect_handler(), APR_DECLARE(), APR_OPTIONAL_FN_TYPE(), close_pipe(), dumpit(), lookup_map_program(), magic_process(), main(), read_write(), read_write_notimeout(), rewritelog(), ssl_util_readfilter(), test_bigread(), test_mod_neg(), test_pipe_writefull(), test_read(), test_seek(), and test_truncate().

const void apr_size_t nbytes
 

Definition at line 404 of file apr_file_io.h.

apr_brigade_flush void const struct iovec apr_size_t nvec
 

Definition at line 857 of file apr_buckets.h.

Referenced by APR_OPTIONAL_FN_TYPE().

apr_file_t apr_off_t offset
 

Definition at line 1477 of file apr_buckets.h.

Referenced by add_extension_info(), AP_DECLARE_NONSTD(), APR_DECLARE(), APU_DECLARE(), child_main(), dav_fs_load_lock_record(), dav_fs_walker(), main(), match(), mget(), remove_items(), set_server_string_slot(), ssl_expr_eval_func_file(), ssl_io_input_getline(), test_file_redir(), test_seek(), and XML_GetBuffer().

apr_off_t offset
 

Definition at line 693 of file apr_file_io.h.

apr_file_t * old_file
 

Definition at line 486 of file apr_file_io.h.

apr_size_t char * out
 

Definition at line 52 of file apr_arch_utf8.h.

Referenced by ap_proxy_send_dir_filter(), APR_OPTIONAL_FN_TYPE(), getstr(), and main().

apr_pool_t* p
 

Definition at line 757 of file apr_file_io.h.

const char apr_int32_t apr_fileperms_t perm
 

Definition at line 108 of file apr_dbm.h.

apr_fileperms_t perms
 

Definition at line 613 of file apr_file_io.h.

Referenced by apr_file_transfer_contents(), apr_unix_mode2perms(), dav_fs_patch_exec(), and dav_fs_patch_rollback().

apr_fileperms_t apr_pool_t* pool
 

Definition at line 667 of file apr_file_io.h.

char* templ
 

Definition at line 740 of file apr_file_io.h.

apr_os_file_t * thefile
 

Definition at line 366 of file apr_portable.h.

Referenced by find_title(), resolve_ident(), test_buffered_write_size(), test_info_get(), test_mtime_set(), test_open_excl(), test_open_noreadwrite(), test_stat_eq_finfo(), and test_uncleared_errno().

apr_interval_time_t timeout
 

Definition at line 242 of file apr_poll.h.

Referenced by AP_DECLARE(), apr_socket_timeout_set(), apr_wait_for_io_or_timeout(), DAV_DECLARE(), main(), pipe_bucket_read(), set_proxy_timeout(), set_timeout(), socket_bucket_read(), and ssl_callback_NewSessionCacheEntry().

const char * to_path
 

Definition at line 241 of file apr_file_io.h.

int type
 

Definition at line 553 of file apr_file_io.h.

apr_brigade_flush void const struct iovec * vec
 

Definition at line 857 of file apr_buckets.h.

Referenced by send_all_header_fields().

apr_int32_t wanted
 

Definition at line 684 of file apr_file_io.h.

apr_sockaddr_t * where
 

Definition at line 535 of file apr_network_io.h.

Referenced by allow_cmd(), and trace_add().