|
RTS API Documentation
1.10.11
|
Collaboration diagram for File I/O Handling Functions:Modules | |
| File Seek Flags | |
| File Permissions flags | |
| File Lock Types | |
| File Open Flags/Routines | |
Data Structures | |
| struct | switch_array_header_t |
Typedefs | |
| typedef struct fspr_file_t | switch_file_t |
| typedef int32_t | switch_fileperms_t |
| typedef int | switch_seek_where_t |
| typedef struct switch_dir | switch_dir_t |
| typedef struct switch_array_header_t | switch_array_header_t |
| typedef struct switch_array_header_t switch_array_header_t |
Definition at line 925 of file switch_apr.h.
| typedef struct switch_dir switch_dir_t |
Definition at line 911 of file switch_apr.h.
| typedef struct fspr_file_t switch_file_t |
Structure for referencing files.
Definition at line 685 of file switch_apr.h.
| typedef int32_t switch_fileperms_t |
Definition at line 687 of file switch_apr.h.
| typedef int switch_seek_where_t |
Definition at line 688 of file switch_apr.h.
| switch_status_t switch_dir_close | ( | switch_dir_t * | thedir | ) |
Definition at line 582 of file switch_apr.c.
References switch_dir::dir_handle.
Referenced by switch_loadable_module_enumerate_available().
| uint32_t switch_dir_count | ( | switch_dir_t * | thedir | ) |
Definition at line 590 of file switch_apr.c.
References count, switch_dir::dir_handle, switch_dir::finfo, name, and SWITCH_STATUS_SUCCESS.
| switch_status_t switch_dir_make | ( | const char * | path, |
| switch_fileperms_t | perm, | ||
| switch_memory_pool_t * | pool | ||
| ) |
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 direcoty. |
| pool | the pool to use. |
Definition at line 546 of file switch_apr.c.
| switch_status_t switch_dir_make_recursive | ( | const char * | path, |
| switch_fileperms_t | perm, | ||
| switch_memory_pool_t * | pool | ||
| ) |
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 direcoty. |
| pool | the pool to use. |
Definition at line 551 of file switch_apr.c.
Referenced by main(), switch_core_init(), and switch_ivr_record_session_event().
| const char* switch_dir_next_file | ( | switch_dir_t * | thedir, |
| char * | buf, | ||
| switch_size_t | len | ||
| ) |
Definition at line 618 of file switch_apr.c.
References buf, switch_dir::dir_handle, switch_dir::finfo, name, switch_copy_string(), and SWITCH_STATUS_SUCCESS.
Referenced by switch_loadable_module_enumerate_available().
| switch_status_t switch_dir_open | ( | switch_dir_t ** | new_dir, |
| const char * | dirname, | ||
| switch_memory_pool_t * | pool | ||
| ) |
Definition at line 561 of file switch_apr.c.
References switch_dir::dir_handle, memset(), and SWITCH_STATUS_FALSE.
Referenced by switch_loadable_module_enumerate_available().
| switch_status_t switch_directory_exists | ( | const char * | dirname, |
| switch_memory_pool_t * | pool | ||
| ) |
Definition at line 497 of file switch_apr.c.
References switch_core_destroy_memory_pool, and switch_core_new_memory_pool.
Referenced by switch_core_perform_file_open().
| switch_status_t switch_file_close | ( | switch_file_t * | thefile | ) |
Close the specified file.
| thefile | The file descriptor to close. |
Definition at line 432 of file switch_apr.c.
Referenced by get_file_size(), main(), and SWITCH_STANDARD_APP().
| switch_status_t switch_file_copy | ( | const char * | from_path, |
| const char * | to_path, | ||
| switch_fileperms_t | perms, | ||
| switch_memory_pool_t * | pool | ||
| ) |
Definition at line 426 of file switch_apr.c.
| switch_status_t switch_file_exists | ( | const char * | filename, |
| switch_memory_pool_t * | pool | ||
| ) |
Definition at line 519 of file switch_apr.c.
References switch_core_destroy_memory_pool, switch_core_new_memory_pool, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and zstr.
Referenced by load_config(), msrp_init_ssl(), switch_core_cert_gen_fingerprint(), switch_core_check_dtls_pem(), switch_core_gen_certs(), switch_core_perform_file_open(), switch_img_txt_handle_create(), and switch_rtp_add_dtls().
| switch_size_t switch_file_get_size | ( | switch_file_t * | thefile | ) |
Definition at line 491 of file switch_apr.c.
References SWITCH_STATUS_SUCCESS.
Referenced by get_file_size(), and SWITCH_STANDARD_APP().
| switch_status_t switch_file_lock | ( | switch_file_t * | thefile, |
| int | type | ||
| ) |
Definition at line 442 of file switch_apr.c.
Referenced by main().
| switch_status_t switch_file_mktemp | ( | switch_file_t ** | thefile, |
| char * | templ, | ||
| int32_t | flags, | ||
| switch_memory_pool_t * | pool | ||
| ) |
Definition at line 486 of file switch_apr.c.
| switch_status_t switch_file_open | ( | switch_file_t ** | newf, |
| const char * | fname, | ||
| int32_t | flag, | ||
| switch_fileperms_t | perm, | ||
| switch_memory_pool_t * | pool | ||
| ) |
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:
SWITCH_FOPEN_READ open for reading
SWITCH_FOPEN_WRITE open for writing
SWITCH_FOPEN_CREATE create the file if not there
SWITCH_FOPEN_APPEND file ptr is set to end prior to all writes
SWITCH_FOPEN_TRUNCATE set length to zero if file exists
SWITCH_FOPEN_BINARY not a text file (This flag is ignored on
UNIX because it has no meaning)
SWITCH_FOPEN_BUFFERED buffer the data. Default is non-buffered
SWITCH_FOPEN_EXCL return error if APR_CREATE and file exists
SWITCH_FOPEN_DELONCLOSE delete the file after closing.
SWITCH_FOPEN_XTHREAD Platform dependent tag to open the file
for use across multiple threads
SWITCH_FOPEN_SHARELOCK Platform dependent support for higher
level locked read/write access to support
writes across process/machines
SWITCH_FOPEN_NOCLEANUP Do not register a cleanup with the pool
passed in on the pool argument (see below).
The fspr_os_file_t handle in fspr_file_t will not
be closed when the pool is destroyed.
SWITCH_FOPEN_SENDFILE_ENABLED Open with appropriate platform semantics
for sendfile operations. Advisory only,
fspr_socket_sendfile does not check this flag.
|
| perm | Access permissions for file. |
| pool | The pool to use. |
Definition at line 411 of file switch_apr.c.
Referenced by get_file_size(), main(), and SWITCH_STANDARD_APP().
| int switch_file_printf | ( | switch_file_t * | thefile, |
| const char * | format, | ||
| ... | |||
| ) |
Definition at line 467 of file switch_apr.c.
References switch_file_write(), and switch_vasprintf().
| switch_status_t switch_file_read | ( | switch_file_t * | thefile, |
| void * | buf, | ||
| switch_size_t * | nbytes | ||
| ) |
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. |
Definition at line 457 of file switch_apr.c.
Referenced by main(), and SWITCH_STANDARD_APP().
| switch_status_t switch_file_remove | ( | const char * | path, |
| switch_memory_pool_t * | pool | ||
| ) |
Delete the specified file.
| path | The full path to the file (using / on all systems) |
| pool | The pool to use. |
Definition at line 452 of file switch_apr.c.
Referenced by record_callback().
| switch_status_t switch_file_rename | ( | const char * | from_path, |
| const char * | to_path, | ||
| switch_memory_pool_t * | pool | ||
| ) |
| switch_status_t switch_file_seek | ( | switch_file_t * | thefile, |
| switch_seek_where_t | where, | ||
| int64_t * | offset | ||
| ) |
Definition at line 417 of file switch_apr.c.
| switch_status_t switch_file_trunc | ( | switch_file_t * | thefile, |
| int64_t | offset | ||
| ) |
Definition at line 437 of file switch_apr.c.
| switch_status_t switch_file_write | ( | switch_file_t * | thefile, |
| const void * | buf, | ||
| switch_size_t * | nbytes | ||
| ) |
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. |
Definition at line 462 of file switch_apr.c.
Referenced by main(), switch_file_printf(), and SWITCH_STANDARD_APP().
1.8.13