Go to the source code of this file.
Classes | |
struct | Eh_file_list |
Functions | |
FILE * | eh_fopen (const gchar *file, const gchar *type) |
gchar * | eh_render_file_error_str (gint err_no) |
FILE * | eh_fopen_error (const gchar *file, const char *type, GError **error) |
void | eh_set_file_error_from_errno (GError **error, const gchar *file, gint err_no) |
FILE * | eh_open_file (const gchar *file, const gchar *type) |
FILE * | eh_open_temp_file (const gchar *template, gchar **name_used) |
gboolean | eh_is_readable_file (const gchar *file) |
gboolean | eh_is_writable_file (const gchar *file) |
gboolean | eh_try_open (const gchar *file) |
gboolean | eh_open_dir (const gchar *dir, GError **error) |
gboolean | try_open (const gchar *file, int flags) |
gboolean | eh_touch_file (const gchar *file, int flags, GError **error) |
gboolean | try_dir (const gchar *file, GError **error) |
Eh_file_list * | eh_create_file_list (char *base_name) |
gchar * | eh_get_next_file (Eh_file_list *list) |
void | eh_destroy_file_list (Eh_file_list *list) |
Eh_file_list* eh_create_file_list | ( | char * | base_name | ) |
Create a list of successive file name.
Create a list of files that all have the same form but contain a numerical portion that is incremented. For instance, a list of files might be something like: file0001.txt, file0002.txt, etc.
The input is a template from which the file of the list will be made. The template must contain one '#' which indicates the position of the increment within the file names. The '#' will be replaced by a number with a format of "%04d".
Use eh_get_next_file to obtain the next file name in the list.
base_name | The form for the files in the list. |
Definition at line 326 of file eh_file_utils.c.
References Eh_file_list::count, eh_free, eh_new, Eh_file_list::format, Eh_file_list::prefix, and Eh_file_list::suffix.
Referenced by init_cpr_data(), and main().
void eh_destroy_file_list | ( | Eh_file_list * | list | ) |
Destroy an Eh_file_list.
list | A pointer to an Eh_file_list. |
Definition at line 371 of file eh_file_utils.c.
References eh_free, Eh_file_list::format, Eh_file_list::prefix, and Eh_file_list::suffix.
Referenced by destroy_cpr().
FILE* eh_fopen | ( | const gchar * | file, | |
const gchar * | type | |||
) |
FILE* eh_fopen_error | ( | const gchar * | file, | |
const char * | type, | |||
GError ** | error | |||
) |
gchar* eh_get_next_file | ( | Eh_file_list * | list | ) |
Get the next file name from an Eh_file_list.
list | A pointer to an Eh_file_list. |
Definition at line 353 of file eh_file_utils.c.
References Eh_file_list::count, eh_free, Eh_file_list::format, Eh_file_list::prefix, and Eh_file_list::suffix.
gboolean eh_is_readable_file | ( | const gchar * | file | ) |
gboolean eh_is_writable_file | ( | const gchar * | file | ) |
gboolean eh_open_dir | ( | const gchar * | dir, | |
GError ** | error | |||
) |
FILE* eh_open_file | ( | const gchar * | file, | |
const gchar * | type | |||
) |
FILE* eh_open_temp_file | ( | const gchar * | template, | |
gchar ** | name_used | |||
) |
gchar* eh_render_file_error_str | ( | gint | err_no | ) |
void eh_set_file_error_from_errno | ( | GError ** | error, | |
const gchar * | file, | |||
gint | err_no | |||
) |
Definition at line 109 of file eh_file_utils.c.
References eh_free, eh_render_file_error_str(), and eh_return_if_fail.
Referenced by eh_fopen_error(), eh_open_dir(), eh_open_scanner(), eh_scan_str(), eh_scan_str_array(), eh_touch_file(), sedflux_setup_project_dir(), and try_dir().
gboolean eh_touch_file | ( | const gchar * | file, | |
int | flags, | |||
GError ** | error | |||
) |
Definition at line 248 of file eh_file_utils.c.
References eh_free, eh_open_dir(), eh_require, eh_return_val_if_fail, and eh_set_file_error_from_errno().
Referenced by init_met_station(), init_river(), and init_subsidence().
gboolean eh_try_open | ( | const gchar * | file | ) |
gboolean try_dir | ( | const gchar * | file, | |
GError ** | error | |||
) |
gboolean try_open | ( | const gchar * | file, | |
int | flags | |||
) |