This section describes the file structure of MSG (msg_file_t) and the functions for managing it. It is based on POSIX functions.
More...
Data Structures |
struct | file_stat |
| Strucure containing information on file like stat on POSIX. More...
|
Typedefs |
typedef struct msg_file * | msg_file_t |
| File datatype.You should consider this as an opaque object.
|
typedef s_file_stat_t | s_msg_stat_t |
| File datatype.You should consider this as an opaque object.
|
typedef struct file_stat | s_file_stat_t |
| Strucure containing information on file like stat on POSIX.
|
Functions |
double | MSG_file_read (void *ptr, size_t size, size_t nmemb, msg_file_t stream) |
| Read elements of a file.
|
size_t | MSG_file_write (const void *ptr, size_t size, size_t nmemb, msg_file_t stream) |
| Write elements into a file.
|
msg_file_t | MSG_file_open (const char *mount, const char *path, const char *mode) |
| Opens the file whose name is the string pointed to by path.
|
int | MSG_file_close (msg_file_t fp) |
| Close the file.
|
int | MSG_file_stat (msg_file_t fd, s_msg_stat_t *buf) |
| Stats the file pointed by fd.
|
void | MSG_file_free_stat (s_msg_stat_t *stat) |
| Free the stat structure.
|
int | MSG_file_unlink (msg_file_t fd) |
| Unlink the file pointed by fd.
|
xbt_dict_t | MSG_file_ls (const char *mount, const char *path) |
| Search for file.
|
Detailed Description
This section describes the file structure of MSG (msg_file_t) and the functions for managing it. It is based on POSIX functions.
@htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Files" --> \endhtmlonly
(msg_file_t) and the functions for managing it.
- See Also
- msg_file_t
Function Documentation
double MSG_file_read |
( |
void * |
ptr, |
|
|
size_t |
size, |
|
|
size_t |
nmemb, |
|
|
msg_file_t |
stream |
|
) |
| |
Read elements of a file.
- Parameters
-
ptr | buffer to where the data is copied |
size | of each element |
nmemb | is the number of elements of data to read |
stream | to read |
- Returns
- the number of items successfully read
size_t MSG_file_write |
( |
const void * |
ptr, |
|
|
size_t |
size, |
|
|
size_t |
nmemb, |
|
|
msg_file_t |
stream |
|
) |
| |
Write elements into a file.
- Parameters
-
ptr | buffer from where the data is copied |
size | of each element |
nmemb | is the number of elements of data to write |
stream | to write |
- Returns
- the number of items successfully write
msg_file_t MSG_file_open |
( |
const char * |
mount, |
|
|
const char * |
path, |
|
|
const char * |
mode |
|
) |
| |
Opens the file whose name is the string pointed to by path.
- Parameters
-
mount | is the mount point where find the file is located |
path | is the file location on the storage |
mode | points to a string beginning with one of the following sequences (Additional characters may follow these sequences.): r Open text file for reading. The stream is positioned at the beginning of the file. r+ Open for reading and writing. The stream is positioned at the beginning of the file. w Truncate file to zero length or create text file for writing. The stream is positioned at the beginning of the file. w+ Open for reading and writing. The file is created if it does not exist, otherwise it is truncated. The stream is positioned at the beginning of the file. a Open for appending (writing at end of file). The file is created if it does not exist. The stream is positioned at the end of the file. a+ Open for reading and appending (writing at end of file). The file is created if it does not exist. The initial file position for reading is at the beginning of the file, but output is always appended to the end of the file. |
- Returns
- An msg_file_t associated to the file
Close the file.
- Parameters
-
- Returns
- 0 on success or 1 on error
Stats the file pointed by fd.
- Parameters
-
fd | is the file descriptor (msg_file_t) |
buf | is the return structure with informations |
- Returns
- 0 on success or 1 on error
Free the stat structure.
- Parameters
-
Unlink the file pointed by fd.
- Parameters
-
- Returns
- 0 on success or 1 on error
xbt_dict_t MSG_file_ls |
( |
const char * |
mount, |
|
|
const char * |
path |
|
) |
| |
Search for file.
- Parameters
-
mount | is the mount point where find the file is located |
path | the file regex to find |
- Returns
- a xbt_dict_t of file where key is the name of file and the value the msg_stat_t corresponding to the key