|
libarmutils
1.4
|
Macros | |
| #define | FC_CHECK_MD5 0x1 |
| use md5 validation when copying a file | |
Functions | |
| int | file_copy (const char *src_file, const char *dest_file, int flags) |
| Copy a file. | |
| int | file_exists (const char *file) |
| Check if a file exists. | |
| char * | file_get_md5 (const char *file, char *hexdigest) |
| Get the MD5 of a file. | |
| int | file_move (const char *src_file, const char *dest_file, int use_md5_validation) |
| Move a file. | |
| void * | file_mmap (const char *file, size_t *map_size) |
| Create a memory map of a file for reading. | |
| int | file_munmap (void *map_addr, size_t map_size) |
| Remove a memory map created to read a file. | |
| int file_copy | ( | const char * | src_file, |
| const char * | dest_file, | ||
| int | flags | ||
| ) |
Copy a file.
This function will prepend the destination file with a '.' and add a '.lck' extenstion to it while the file is being copied. When the copy has been completed successfuly the rename function is used to remove the '.' prefix and '.lck' extension.
Error messages from this function are sent to the message handler (see msngr_init_log() and msngr_init_mail()).
| src_file | - path to the source file |
| dest_file | - path to the destination file |
| flags | - control flags |
Control Flags:
Definition at line 74 of file file_utils.c.
| int file_exists | ( | const char * | file | ) |
Check if a file exists.
| file | - path to the file |
Definition at line 303 of file file_utils.c.
| char* file_get_md5 | ( | const char * | file, |
| char * | hexdigest | ||
| ) |
Get the MD5 of a file.
The hexdigest buffer must be large enough to hold 33 characters (32 for the hex value plus one for the string terminator).
Error messages from this function are sent to the message handler (see msngr_init_log() and msngr_init_mail()).
| file | - path to the file |
| hexdigest | - buffer to store the MD5 hexdigext value |
Definition at line 328 of file file_utils.c.
| void* file_mmap | ( | const char * | file, |
| size_t * | map_size | ||
| ) |
Create a memory map of a file for reading.
Error messages from this function are sent to the message handler (see msngr_init_log() and msngr_init_mail()).
| file | - path to the file |
| map_size | - returns the size of the memory mapped file |
Definition at line 488 of file file_utils.c.
| int file_move | ( | const char * | src_file, |
| const char * | dest_file, | ||
| int | flags | ||
| ) |
Move a file.
This function will first attempt to simply rename the file. If the rename fails because the file is being moved across file systems, the file_copy() function will be used and the source file deleted.
Error messages from this function are sent to the message handler (see msngr_init_log() and msngr_init_mail()).
| src_file | - path to the old file name |
| dest_file | - path to the new file name |
| flags | - control flags |
Control Flags:
Definition at line 405 of file file_utils.c.
| int file_munmap | ( | void * | map_addr, |
| size_t | map_size | ||
| ) |
Remove a memory map created to read a file.
Error messages from this function are sent to the message handler (see msngr_init_log() and msngr_init_mail()).
| map_addr | - address of the memory map |
| map_size | - size of the memory mapped file |
Definition at line 545 of file file_utils.c.