Go to the source code of this file.
Defines | |
#define | FILES_UTIL_INIT_BUFF_SIZE 2048 |
This value is used by various functions that need to allocate buffers. This represents the initial size of the buffer (in bytes). | |
#define | FILES_UTIL_MALLOC_ERR -1 |
Return value for the function read_file(). The function can not allocate memory. | |
#define | FILES_UTIL_READ_ERR -2 |
Return value for the function read_file(). An error occured while reading the input file. | |
#define | FILES_UTIL_OPEN_ERR -3 |
Return value for the function read_file(). Can not open the input file. | |
#define | SET_TIMEOUT_FILE_OPEN_ERROR -4 |
Return value for the function set_timeout_file(). Can not open target file. | |
#define | SET_TIMEOUT_FILE_WRITE_ERROR -5 |
Return value for the function set_timeout_file(). An error occured while writing into the target file. | |
#define | SET_TIMEOUT_FILE_OK -6 |
Return value for the function set_timeout_file(). Timeout file set correctly. | |
#define | TEST_TIMEOUT_FILE_TIMEOUT_ELLAPSED -7 |
Return value for the function test_timeout_file(). The timeout is passed. | |
#define | TEST_TIMEOUT_FILE_READ_ERROR -8 |
Return value for the function test_timeout_file(). An error occured while reading the timeout file. | |
#define | TEST_TIMEOUT_FILE_TIMEOUT_NOT_ELLAPSED -9 |
Return value for the function test_timeout_file(). The timeout is not passed (you may have to wait). | |
#define | TEST_TIMEOUT_FILE_UNLINK_FAILED -10 |
Return value for the function test_timeout_file(). The function could not delete the timeout file. | |
#define | FILES_HD |
Functions | |
int | wait_for_file (char *file_name, int period, char *stop_file) |
Wait for a file to appear. | |
char * | wait_for_multiple_file (char **file_names, int period, char *stop_file) |
Wait for a file (within a list of files) to exist. | |
int | read_file (char *file_name, char **buff) |
Load the content of a file into an in-memory buffer. | |
int | set_timeout_file (char *filename) |
Set the timeout file that contains the current number of seconds since January 1970 00:00:00. | |
int | test_timeout_file (char *filename, int timeout) |
Look at a timeout file to see if the calling process should wait or go ahead. | |
void | basename (char *src, char *dst) |
Extract the base name of a given file name. |
Definition in file files.h.
|
Extract the base name of a given file name.
|
|
Load the content of a file into an in-memory buffer.
Definition at line 96 of file files.c. References FILES_UTIL_INIT_BUFF_SIZE, FILES_UTIL_MALLOC_ERR, FILES_UTIL_OPEN_ERR, and FILES_UTIL_READ_ERR. |
|
Set the timeout file that contains the current number of seconds since January 1970 00:00:00.
Definition at line 159 of file files.c. References SET_TIMEOUT_FILE_OK, SET_TIMEOUT_FILE_OPEN_ERROR, and SET_TIMEOUT_FILE_WRITE_ERROR. |
|
Look at a timeout file to see if the calling process should wait or go ahead.
Definition at line 198 of file files.c. References TEST_TIMEOUT_FILE_READ_ERROR, TEST_TIMEOUT_FILE_TIMEOUT_ELLAPSED, TEST_TIMEOUT_FILE_TIMEOUT_NOT_ELLAPSED, and TEST_TIMEOUT_FILE_UNLINK_FAILED. |
|
Wait for a file to appear.
|
|
Wait for a file (within a list of files) to exist.
|