|
Apache HTTPD
|
Modules | |
| File Open Flags/Routines | |
| File Seek Flags | |
| File Attribute Flags | |
| {_full} max iovec size | |
| File Lock Types | |
Typedefs | |
| typedef apr_uint32_t | apr_fileattrs_t |
| typedef int | apr_seek_where_t |
| typedef struct apr_file_t | apr_file_t |
Functions | |
| APR_DECLARE (apr_status_t) apr_file_open(apr_file_t **newf | |
| APR_DECLARE (apr_size_t) apr_file_buffer_size_get(apr_file_t *thefile) | |
| 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_DECLARE (apr_pool_t *) apr_file_pool_get(const apr_file_t *thefile) | |
Structure for referencing files.
Definition at line 188 of file apr_file_io.h.
File attributes
Definition at line 180 of file apr_file_io.h.
Type to pass as whence argument to apr_file_seek.
Definition at line 183 of file apr_file_io.h.
| APR_DECLARE | ( | apr_int32_t | ) |
Retrieve the flags that were passed into apr_file_open() when the file was opened.
| APR_DECLARE | ( | apr_pool_t * | ) | const |
Get the pool used by the file.
| APR_DECLARE | ( | apr_size_t | ) |
Get the size of any buffer for the specified apr file handle
| thefile | The file handle |
Get the true size that would be allocated for the given size (including the header and alignment).
| allocator | The allocator from which to the memory would be allocated |
| size | The size to align |
| APR_DECLARE | ( | apr_status_t | ) |
Open the specified file.
| newf | The opened file descriptor. |
| fname | The full path to the file (using / on all systems) |
| flag | Or'ed value of:
|
| perm | Access permissions for file. |
| pool | The pool to use. |
Close the specified file.
| file | The file descriptor to close. |
Delete the specified file.
| path | The full path to the file (using / on all systems) |
| pool | The pool to use. |
Rename the specified file.
| from_path | The full path to the original file (using / on all systems) |
| to_path | The full path to the new file (using / on all systems) |
| pool | The pool to use. |
Create a hard link to the specified file.
| from_path | The full path to the original file (using / on all systems) |
| to_path | The full path to the new file (using / on all systems) |
Copy the specified file to another file.
| from_path | The full path to the original file (using / on all systems) |
| to_path | The full path to the new file (using / on all systems) |
| perms | Access permissions for the new file if it is created. In place of the usual or'd combination of file permissions, the value APR_FPROT_FILE_SOURCE_PERMS may be given, in which case the source file's permissions are copied. |
| pool | The pool to use. |
Append the specified file to another file.
| from_path | The full path to the source file (use / on all systems) |
| to_path | The full path to the destination file (use / on all systems) |
| perms | Access permissions for the destination file if it is created. In place of the usual or'd combination of file permissions, the value APR_FPROT_FILE_SOURCE_PERMS may be given, in which case the source file's permissions are copied. |
| pool | The pool to use. |
Are we at the end of the file
| fptr | The apr file we are testing. |
Open standard error as an apr file pointer.
| thefile | The apr file to use as stderr. |
| pool | The pool to allocate the file out of. |
open standard output as an apr file pointer.
| thefile | The apr file to use as stdout. |
| pool | The pool to allocate the file out of. |
open standard input as an apr file pointer.
| thefile | The apr file to use as stdin. |
| pool | The pool to allocate the file out of. |
open standard error as an apr file pointer, with flags.
| thefile | The apr file to use as stderr. |
| flags | The flags to open the file with. Only the
|
| pool | The pool to allocate the file out of. |
open standard output as an apr file pointer, with flags.
| thefile | The apr file to use as stdout. |
| flags | The flags to open the file with. Only the
|
| pool | The pool to allocate the file out of. |
open standard input as an apr file pointer, with flags.
| thefile | The apr file to use as stdin. |
| flags | The flags to open the file with. Only the
|
| pool | The pool to allocate the file out of. |
Read data from the specified file.
| thefile | The file descriptor to read from. |
| buf | The buffer to store the data to. |
| nbytes | On entry, the number of bytes to read; on exit, the number of bytes read. |
Write data to the specified file.
| thefile | The file descriptor to write to. |
| buf | The buffer which contains the data. |
| nbytes | On entry, the number of bytes to write; on exit, the number of bytes written. |
Write data from iovec array to the specified file.
| thefile | The file descriptor to write to. |
| vec | The array from which to get the data to write to the file. |
| nvec | The number of elements in the struct iovec array. This must be smaller than APR_MAX_IOVEC_SIZE. If it isn't, the function will fail with APR_EINVAL. |
| nbytes | The number of bytes written. |
Read data from the specified file, ensuring that the buffer is filled before returning.
| thefile | The file descriptor to read from. |
| buf | The buffer to store the data to. |
| nbytes | The number of bytes to read. |
| bytes_read | If non-NULL, this will contain the number of bytes read. |
Write data to the specified file, ensuring that all of the data is written before returning.
| thefile | The file descriptor to write to. |
| buf | The buffer which contains the data. |
| nbytes | The number of bytes to write. |
| bytes_written | If non-NULL, set to the number of bytes written. |
Write data from iovec array to the specified file, ensuring that all of the data is written before returning.
| thefile | The file descriptor to write to. |
| vec | The array from which to get the data to write to the file. |
| nvec | The number of elements in the struct iovec array. This must be smaller than APR_MAX_IOVEC_SIZE. If it isn't, the function will fail with APR_EINVAL. |
| nbytes | The number of bytes written. |
Write a character into the specified file.
| ch | The character to write. |
| thefile | The file descriptor to write to |
Read a character from the specified file.
| ch | The character to read into |
| thefile | The file descriptor to read from |
Put a character back onto a specified stream.
| ch | The character to write. |
| thefile | The file descriptor to write to |
Read a line from the specified file
| str | The buffer to store the string in. |
| len | The length of the string |
| thefile | The file descriptor to read from |
Write the string into the specified file.
| str | The string to write. |
| thefile | The file descriptor to write to |
Flush the file's buffer.
| thefile | The file descriptor to flush |
Transfer all file modified data and metadata to disk.
| thefile | The file descriptor to sync |
Transfer all file modified data to disk.
| thefile | The file descriptor to sync |
Duplicate the specified file descriptor.
| new_file | The structure to duplicate into. |
| old_file | The file to duplicate. |
| p | The pool to use for the new file. |
Duplicate the specified file descriptor and close the original
| new_file | The old file that is to be closed and reused |
| old_file | The file to duplicate |
| p | The pool to use for the new file |
Move the specified file descriptor to a new pool
| new_file | Pointer in which to return the new apr_file_t |
| old_file | The file to move |
| p | The pool to which the descriptor is to be moved |
Give the specified apr file handle a new buffer
| thefile | The file handle that is to be modified |
| buffer | The buffer |
| bufsize | The size of the buffer |
Move the read/write file offset to a specified byte within a file.
| thefile | The file descriptor |
| where | How to move the pointer, one of: |
| offset | The offset to move the pointer to. |
Create an anonymous pipe.
| in | The newly created pipe's file for reading. |
| out | The newly created pipe's file for writing. |
| pool | The pool to operate on. |
Create an anonymous pipe which portably supports async timeout options.
| in | The newly created pipe's file for reading. |
| out | The newly created pipe's file for writing. |
| blocking | one of these values defined in apr_thread_proc.h; |
| pool | The pool to operate on. |
Create an anonymous pipe which portably supports async timeout options, placing each side of the pipe in a different pool.
| in | The newly created pipe's file for reading. |
| out | The newly created pipe's file for writing. |
| blocking | one of these values defined in apr_thread_proc.h; |
| pool_in | The pool for the reading pipe. |
| pool_out | The pool for the writing pipe. |
Create a named pipe.
| filename | The filename of the named pipe |
| perm | The permissions for the newly created pipe. |
| pool | The pool to operate on. |
Get the timeout value for a pipe or manipulate the blocking state.
| thepipe | The pipe we are getting a timeout for. |
| timeout | The current timeout value in microseconds. |
Set the timeout value for a pipe or manipulate the blocking state.
| thepipe | The pipe we are setting a timeout on. |
| timeout | The timeout value in microseconds. Values < 0 mean wait forever, 0 means do not wait at all. |
file (un)locking functions. Establish a lock on the specified, open file. The lock may be advisory or mandatory, at the discretion of the platform. The lock applies to the file as a whole, rather than a specific range. Locks are established on a per-thread/process basis; a second lock by the same thread will not block.
| thefile | The file to lock. |
| type | The type of lock to establish on the file. |
Remove any outstanding locks on the file.
| thefile | The file to unlock. |
accessor and general file_io functions. return the file name of the current file.
| new_path | The path of the file. |
| thefile | The currently open file. |
Return the data associated with the current file.
| data | The user data associated with the file. |
| key | The key to use for retrieving data associated with this file. |
| file | The currently open file. |
Set the data associated with the current file.
| file | The currently open file. |
| data | The user data to associate with the file. |
| key | The key to use for associating data with the file. |
| cleanup | The cleanup routine to use when the file is destroyed. |
set the specified file's permission bits.
| fname | The file (name) to apply the permissions to. |
| perms | The permission bits to apply to the file. |
Set attributes of the specified file.
| fname | The full path to the file (using / on all systems) |
| attributes | Or'd combination of
|
| attr_mask | Mask of valid bits in attributes. |
| pool | the pool to use. |
Set the mtime of the specified file.
| fname | The full path to the file (using / on all systems) |
| mtime | The mtime to apply to the file. |
| pool | The pool to use. |
Create a new directory on the file system.
| path | the path for the directory to be created. (use / on all systems) |
| perm | Permissions for the new directory. |
| pool | the pool to use. |
Creates a new directory on the file system, but behaves like 'mkdir -p'. Creates intermediate directories as required. No error will be reported if PATH already exists.
| path | the path for the directory to be created. (use / on all systems) |
| perm | Permissions for the new directory. |
| pool | the pool to use. |
Remove directory from the file system.
| path | the path for the directory to be removed. (use / on all systems) |
| pool | the pool to use. |
get the specified file's stats.
| finfo | Where to store the information about the file. |
| wanted | The desired apr_finfo_t fields, as a bit flag of APR_FINFO_* values |
| thefile | The file to get information about. |
Truncate the file's length to the specified offset
| fp | The file to truncate |
| offset | The offset to truncate to. |
Set a file to be inherited by child processes.
Unset a file from being inherited by child processes.
Open a temporary file
| fp | The apr file to use as a temporary file. |
| templ | The template to use when creating a temp file. |
| flags | The flags to open the file with. If this is zero, the file is opened with APR_FOPEN_CREATE | APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_EXCL | APR_FOPEN_DELONCLOSE |
| p | The pool to allocate the file out of. |
Find an existing directory suitable as a temporary storage location.
| temp_dir | The temp directory. |
| p | The pool to use for any necessary allocations. |
< File is read-only
< File is executable
< all protections
< File is read-only
< File is read-only
< Write by user
<
< Write by group
<
< Write by others
<
< Write by user
<
< Write by group
<
< Write by others
<
< File is executable
< File is executable
< Execute by user
<
< Execute by group
<
< Execute by others
<
< Execute by user
<
< Execute by group
<
< Execute by others
<
< Stat the link not the file itself if it is a link
< Stat the link not the file itself if it is a link
< ->name in proper case
< ->name in proper case
< Access Time
< Create the file if not there
< Open the file for reading
< Open the file for writing
< Delete the file after close
< Open should fail if APR_FOPEN_CREATE and file exists.
< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.
< Read by user
<
< Write by user
<
< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.
< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.
< ->name in proper case
< Modification Time
< Access Time
< Creation or inode-changed time
< Type
< Size of the file
< Storage size consumed by the file
< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.
< ->name in proper case
< ->name in proper case
< Type
< all protections
< ->name in proper case
< ->name in proper case
< File is read-only
< File is hidden
< File is read-only
< File is read-only
< File is hidden
< File is hidden
< Platform dependent flag to enable * non blocking file io
< Open the file for reading
< Open the file for writing
< Open the file for reading
< Open the file for writing
< Open the file for buffered I/O
< Create the file if not there
< Open should fail if APR_FOPEN_CREATE and file exists.
< Open the file and truncate to 0 length
< Open should fail if APR_FOPEN_CREATE and file exists.
< Create the file if not there
< Open the file and truncate to 0 length
< Append to the end of the file
< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.
< Delete the file after close
< Open the file for buffered I/O
< Open the file for writing
< Open the file for writing
< Open the file for reading
< Append to the end of the file
< an atomic unix apr_stat()
< Open the file for writing
< Create the file if not there
< Open the file and truncate to 0 length
< Open the file for writing
< Create the file if not there
< Append to the end of the file
< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.
< File is read-only
< File is executable
< all protections
< File is read-only
< File is read-only
< Write by user
<
< Write by group
<
< Write by others
<
< Write by user
<
< Write by group
<
< Write by others
<
< File is executable
< File is executable
< Execute by user
<
< Execute by group
<
< Execute by others
<
< Execute by user
<
< Execute by group
<
< Execute by others
<
< Access Time
< Stat the link not the file itself if it is a link
< Stat the link not the file itself if it is a link
< Stat the link not the file itself if it is a link
< Create the file if not there
< Open the file for reading
< Open the file for writing
< Open should fail if APR_FOPEN_CREATE and file exists.
< Delete the file after close
< Open the file for reading
< Open the file for writing
< Open the file for reading
< Open the file for writing
< Create the file if not there
< Open should fail if APR_FOPEN_CREATE and file exists.
< Open should fail if APR_FOPEN_CREATE and file exists.
< Create the file if not there
< Append to the end of the file
< Open the file and truncate to 0 length
< Platform dependent flag to enable * non blocking file io
< use OS's default permissions
<
< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.
< Open the file for buffered I/O
< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.
< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.
< Open the file for buffered I/O
< Open the file for writing
< Open the file for writing
< Open the file for reading
< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.
< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.
The problem with trying to output the entire iovec is that we cannot maintain the behaviour that a real writev would have. If we iterate over the iovec one at a time, we lose the atomic properties of writev(). The other option is to combine the entire iovec into one buffer that we could then send in one call to write(). This is not reasonable since we do not know how much data an iovec could contain.
The only reasonable option, that maintains the semantics of a real writev(), is to only write the first iovec. Callers of file_writev() must deal with partial writes as they normally would. If you want to ensure an entire iovec is written, use apr_file_writev_full().
< ->name in proper case
< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.
< Size of the file
< Size of the file
< dev and inode
< Number of links
< ->name in proper case
< Type
< Type
< ->name in proper case
< File is read-only
< File is hidden
< File is read-only
< File is read-only
< File is hidden
< File is hidden
< Open the file for reading
< use OS's default permissions
<
< Platform dependent flag to enable * non blocking file io
< Open the file for reading
< Open the file for writing
< Create the file if not there
< Open should fail if APR_FOPEN_CREATE and file exists.
< Open the file and truncate to 0 length
< Open the file and truncate to 0 length
< Open should fail if APR_FOPEN_CREATE and file exists.
< Create the file if not there
< Delete the file after close
< Open the file for reading
< Open the file for writing
< Platform dependent tag to open the file for use across multiple threads
< Append to the end of the file
< Open the file for buffered I/O
< Platform dependent flag to enable * sparse file support, see WARNING below
< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed.
< Append to the end of the file
< Open the file for buffered I/O
< Open the file for writing
< Open the file for writing
< Open the file for reading
< Platform dependent tag to open the file for use across multiple threads
< Platform dependent tag to open the file for use across multiple threads
< Platform dependent tag to open the file for use across multiple threads
< Platform dependent tag to open the file for use across multiple threads
< Platform dependent tag to open the file for use across multiple threads
< Platform dependent tag to open the file for use across multiple threads
< Exclusive lock. Only one process may hold an exclusive lock at any given time. This is analogous to a "write lock".
< Platform dependent tag to open the file for use across multiple threads
< Platform dependent tag to open the file for use across multiple threads
< Platform dependent tag to open the file for use across multiple threads
< Platform dependent tag to open the file for use across multiple threads
< Size of the file
< Platform dependent tag to open the file for use across multiple threads
< Size of the file
Definition at line 74 of file apr_atomic.c.
| APR_DECLARE_NONSTD | ( | int | ) |
Write a string to a file using a printf format.
| fptr | The file to write to. |
| format | The format string |
| ... | The values to substitute in the format string |
Definition at line 707 of file readwrite.c.
| apr_fileattrs_t apr_fileattrs_t attr_mask |
Definition at line 880 of file apr_file_io.h.
| apr_fileattrs_t attributes |
Definition at line 879 of file apr_file_io.h.
| apr_file_t apr_int32_t blocking |
Definition at line 730 of file apr_file_io.h.
| const void * buf |
Definition at line 453 of file apr_file_io.h.
| char* buffer |
Definition at line 667 of file apr_file_io.h.
| char apr_size_t bufsize |
Definition at line 668 of file apr_file_io.h.
| void apr_size_t apr_size_t* bytes_read |
Definition at line 515 of file apr_file_io.h.
| const void apr_size_t apr_size_t* bytes_written |
Definition at line 540 of file apr_file_io.h.
| void const char apr_status_t(* cleanup) (void *)) | ( | void * | ) |
Definition at line 834 of file apr_file_io.h.
| void* data |
Definition at line 832 of file apr_file_io.h.
| const char apr_file_t* file |
Definition at line 823 of file apr_file_io.h.
| const char apr_int32_t flag |
Definition at line 251 of file apr_file_io.h.
| char apr_int32_t flags |
Definition at line 391 of file apr_file_io.h.
Definition at line 250 of file apr_file_io.h.
Definition at line 844 of file apr_file_io.h.
| const void apr_size_t const unsigned char key |
Definition at line 822 of file apr_file_io.h.
| int len |
Definition at line 589 of file apr_file_io.h.
| apr_time_t mtime |
Definition at line 892 of file apr_file_io.h.
| const struct iovec apr_size_t apr_size_t * nbytes |
Definition at line 454 of file apr_file_io.h.
| const struct iovec apr_size_t nvec |
Definition at line 491 of file apr_file_io.h.
| apr_off_t offset |
Definition at line 689 of file apr_file_io.h.
| apr_file_t * old_file |
Definition at line 625 of file apr_file_io.h.
| apr_size_t char * out |
Definition at line 705 of file apr_file_io.h.
| apr_pool_t * p |
Definition at line 626 of file apr_file_io.h.
| apr_fileperms_t perm |
Definition at line 251 of file apr_file_io.h.
| apr_fileperms_t perms |
Definition at line 305 of file apr_file_io.h.
| apr_pool_t * pool |
Definition at line 252 of file apr_file_io.h.
| apr_file_t apr_int32_t apr_pool_t* pool_in |
Definition at line 757 of file apr_file_io.h.
| apr_file_t apr_int32_t apr_pool_t apr_pool_t* pool_out |
Definition at line 758 of file apr_file_io.h.
| char* templ |
Definition at line 983 of file apr_file_io.h.
| apr_int32_t apr_file_t * thefile |
Definition at line 565 of file apr_file_io.h.
Definition at line 776 of file apr_file_io.h.
Definition at line 279 of file apr_file_io.h.
| int type |
Definition at line 798 of file apr_file_io.h.
Definition at line 490 of file apr_file_io.h.
| apr_int32_t wanted |
Definition at line 931 of file apr_file_io.h.
| apr_seek_where_t where |
Definition at line 688 of file apr_file_io.h.