Functions | |
| cu_order_t | cuos_file_order (cu_str_t path0, cu_str_t path1) |
| int | cuos_file_update (cu_str_t tmp_path, cu_str_t dst_path) |
| FILE * | cuos_fopen (cu_str_t path, char const *mode) |
| cu_order_t cuos_file_order | ( | cu_str_t | path0, | |
| cu_str_t | path1 | |||
| ) |
Returns the ordering relation of the content of the files at path0 and path1, or cu_order_none if an error occured. The order is that of the first differing byte, where EOF is taken as zero. When en error occurs, errno will be set by fopen.
If the file at tmp_path differ or cannot be compared to that at dst_path, renames tmp_path to dst_path (overwriting the latter) and returns 1, otherwise removes tmp_path and returns 0. In case of error -1 is returned, and errno is set by the system unlink or rename call.
| FILE* cuos_fopen | ( | cu_str_t | path, | |
| char const * | mode | |||
| ) |
Calls fopen with path converted to a C string.