ARB
|
#include "arb_file.h"
#include "arb_string.h"
#include "arb_msg.h"
#include <unistd.h>
#include <utime.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <cstdio>
#include <cerrno>
Go to the source code of this file.
Functions | |
long | GB_size_of_file (const char *path) |
long | GB_size_of_FILE (FILE *in) |
unsigned long | GB_time_of_file (const char *path) |
GB_ERROR | GB_set_time_of_file (const char *path, unsigned long new_time) |
long | GB_mode_of_file (const char *path) |
long | GB_mode_of_link (const char *path) |
bool | GB_is_regularfile (const char *path) |
bool | GB_is_link (const char *path) |
bool | GB_is_fifo (const char *path) |
bool | GB_is_fifo (FILE *fp) |
bool | GB_is_executablefile (const char *path) |
bool | GB_is_privatefile (const char *path, bool read_private) |
bool | mode_is_user_writeable (long mode) |
bool | GB_is_writeablefile (const char *filename) |
static bool | GB_is_readable (const char *file_or_dir) |
bool | GB_is_readablefile (const char *filename) |
bool | GB_is_directory (const char *path) |
long | GB_getuid_of_file (const char *path) |
int | GB_unlink (const char *path) |
void | GB_unlink_or_warn (const char *path, GB_ERROR *error) |
GB_ERROR | GB_symlink (const char *target, const char *link) |
GB_ERROR | GB_set_mode_of_file (const char *path, long mode) |
char * | GB_follow_unix_link (const char *path) |
GB_ERROR | GB_move_file (const char *oldpath, const char *newpath) |
GB_ERROR | GB_copy_file (const char *srcpath, const char *dstpath) |
GB_ERROR | GB_safe_rename_file (const char *oldpath, const char *newpath) |
GB_ERROR | GB_safe_copy_file (const char *oldpath, const char *newpath) |
Definition at line 28 of file arb_file.cxx.
Referenced by arb_look_and_start_server(), ARB_main(), aw_help_edit_help(), enter_stage_1_build_tree(), enter_stage_2_load_tree(), gb_map_mapfile(), GB_read_file(), get_full_qualified_help_file_name(), PT_dump_tree_statistics(), PTD_read_leafs_from_disk(), run_command(), and start_pt_server().
long GB_size_of_FILE | ( | FILE * | in | ) |
Definition at line 34 of file arb_file.cxx.
References GB_export_error().
Referenced by GB_login(), GB_map_FILE(), and gb_recover_corrupt_file().
Definition at line 44 of file arb_file.cxx.
Referenced by ARB_main(), aw_help_helpfile_changed_cb(), ArbDBWriter::finishSave(), GB_login(), gb_read_bin(), File_selection::get_newest_dir_modtime(), ptserver(), ptserver_gene(), server_load(), server_save(), and startup_gui().
Definition at line 50 of file arb_file.cxx.
References GB_IO_error(), and NULp.
Referenced by ArbDBWriter::finishSave().
Definition at line 60 of file arb_file.cxx.
Referenced by ArbDBWriter::finishSave(), GB_is_writeablefile(), GB_move_file(), pd_export_pt_server(), GB_MAIN_TYPE::save_quick_as(), and RecordingMacro::stop().
Definition at line 68 of file arb_file.cxx.
Referenced by gb_read_bin(), and GB_MAIN_TYPE::save_quick_as().
bool GB_is_regularfile | ( | const char * | path | ) |
Definition at line 76 of file arb_file.cxx.
Referenced by ARB_textfiles_have_difflines(), aw_help_edit_help(), AW_is_file(), TrackedFile::callAll(), check_argument_for_mode(), deleteSuperfluousQuicksaves(), detectArgType(), detectProperties(), existingPixmap(), GB_is_writeablefile(), GB_safe_copy_file(), GB_safe_rename_file(), GBT_check_arb_file(), FormatTester::handle_action_cb(), main(), read_export_format(), renameQuicksaves(), and run_command().
bool GB_is_link | ( | const char * | path | ) |
Definition at line 83 of file arb_file.cxx.
Referenced by AW_is_link(), File_selection::filename_changed(), and GB_is_writeablefile().
bool GB_is_fifo | ( | const char * | path | ) |
Definition at line 89 of file arb_file.cxx.
Referenced by ARB_zfclose(), gb_recover_corrupt_file(), and ArbDBWriter::startSaveAs().
bool GB_is_fifo | ( | FILE * | fp | ) |
Definition at line 95 of file arb_file.cxx.
bool GB_is_executablefile | ( | const char * | path | ) |
Definition at line 101 of file arb_file.cxx.
Referenced by ARB_executable().
bool GB_is_privatefile | ( | const char * | path, |
bool | read_private | ||
) |
Definition at line 124 of file arb_file.cxx.
Referenced by canvas_to_printer(), export_format_single(), GB_install_pid(), gbl_exec(), and ArbImporter::next_file().
|
inline |
Definition at line 146 of file arb_file.cxx.
Referenced by GB_is_writeablefile().
bool GB_is_writeablefile | ( | const char * | filename | ) |
Definition at line 148 of file arb_file.cxx.
References GB_follow_unix_link(), GB_is_link(), GB_is_regularfile(), GB_is_writeablefile(), GB_mode_of_file(), and mode_is_user_writeable().
Referenced by aw_help_edit_help(), GB_is_writeablefile(), FormatTester::handle_action_cb(), and probe_read_data_base().
|
static |
Definition at line 161 of file arb_file.cxx.
Referenced by GB_is_readablefile().
bool GB_is_readablefile | ( | const char * | filename | ) |
Definition at line 172 of file arb_file.cxx.
References GB_is_directory(), and GB_is_readable().
Referenced by accept_selected_ref_db(), check_valid_existing_fts(), check_valid_target_fts(), find_macro_in(), fullMacroname(), GB_existing_file(), GBS_read_dir(), getSelectedRuleset(), newRefDbSelected_cb(), RecordingMacro::RecordingMacro(), refDbModeChanged_cb(), ruleset_awar_changed_cb(), and selected_fts_changed_cb().
bool GB_is_directory | ( | const char * | path | ) |
Definition at line 176 of file arb_file.cxx.
Referenced by AW_create_fileselection_awars(), aw_help_edit_help(), AW_is_dir(), check_argument_for_mode(), detectArgType(), export_filename_changed_cb(), File_selection::filename_changed(), fts_filesel_changed_cb(), GB_create_directory(), GB_create_parent_directory(), GB_is_readablefile(), GBS_read_dir(), getenv_autodirectory(), getenv_existing_directory(), StorableSelectionList::load(), LoadMenus(), MG_exit(), scan_existing_input_masks(), set_suffix(), and start_macro_cb().
Definition at line 182 of file arb_file.cxx.
Referenced by GB_MAIN_TYPE::save_quick_as().
unlink a file
Definition at line 188 of file arb_file.cxx.
References GB_export_error(), and GB_IO_error().
Referenced by delete_macro_cb(), deleteRuleset_cb(), deleteSuperfluousQuicksaves(), enter_stage_1_build_tree(), GB_delete_database(), GB_unlink_or_warn(), FormatTester::handle_action_cb(), and GB_MAIN_TYPE::save_quick_as().
Definition at line 206 of file arb_file.cxx.
References GB_await_error(), GB_unlink(), and GB_warning().
Referenced by canvas_to_printer(), export_format_single(), export_seq_data(), export_structure_to_file(), ArbDBWriter::finishSave(), gb_delete_reference(), gb_remove_all_but_main(), gb_remove_quick_saved(), gb_save_mapfile(), gbl_exec(), ArbImporter::next_file(), GB_MAIN_TYPE::save_quick(), tree_load_cb(), TREE_write_Newick(), and update_exportTest_result_cb().
Definition at line 221 of file arb_file.cxx.
References error(), GB_IO_error(), GBS_global_string_copy(), and NULp.
Referenced by GB_MAIN_TYPE::save_quick_as().
Definition at line 231 of file arb_file.cxx.
References GB_IO_error(), GBS_global_string(), and NULp.
Referenced by enter_stage_1_build_tree(), ArbDBWriter::finishSave(), gb_add_reference(), gb_create_reference(), GB_move_file(), pd_export_pt_server(), GB_MAIN_TYPE::save_quick_as(), and RecordingMacro::stop().
Definition at line 262 of file arb_file.cxx.
References ARB_strdup(), buffer, GBS_global_string_copy(), and NULp.
Referenced by GB_is_writeablefile(), gb_read_bin(), and GB_MAIN_TYPE::save_quick_as().
Definition at line 284 of file arb_file.cxx.
References error(), GB_IO_error(), GB_mode_of_file(), GB_set_mode_of_file(), GBS_global_string(), and NULp.
Referenced by awtc_delete_names_file(), enter_stage_1_build_tree(), ArbDBWriter::finishSave(), GB_safe_rename_file(), renameQuicksaves(), GB_MAIN_TYPE::save_quick(), and server_save().
Definition at line 302 of file arb_file.cxx.
References arb_assert, error(), GB_IO_error(), and NULp.
Referenced by GB_safe_copy_file().
Definition at line 332 of file arb_file.cxx.
References error(), GB_is_regularfile(), GB_move_file(), and NULp.
Referenced by copyMoveRuleset_cb().
Definition at line 342 of file arb_file.cxx.
References error(), GB_copy_file(), GB_is_regularfile(), and NULp.
Referenced by copyMoveRuleset_cb().