#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <utime.h>
#include <limits.h>
#include <stdlib.h>
#include <cstdio>
#include <cerrno>
#include <iostream>
#include <fstream>
#include <vector>
#include "op_file.h"
#include "file_manip.h"
#include "string_manip.h"
Go to the source code of this file.
Functions | |
bool | copy_file (string const &source, string const &destination) |
bool | is_directory (string const &dirname) |
bool | is_files_identical (string const &file1, string const &file2) |
string const | op_realpath (string const &name) |
bool | op_file_readable (string const &file) |
static void | get_pathname (const char *pathname, void *name_list) |
bool | create_file_list (list< string > &file_list, string const &base_dir, string const &filter, bool recursive) |
static string | erase_trailing_path_separator (string const &path_name) |
string | op_dirname (string const &file_name) |
string | op_basename (string const &path_name) |
Useful file management helpers
Definition in file file_manip.cpp.
bool copy_file | ( | string const & | source, | |
string const & | destination | |||
) |
Definition at line 33 of file file_manip.cpp.
References op_file_readable().
bool create_file_list | ( | list< string > & | file_list, | |
string const & | base_dir, | |||
string const & | filter, | |||
bool | recursive | |||
) |
Definition at line 118 of file file_manip.cpp.
References get_matching_pathnames(), get_pathname(), MATCH_ANY_ENTRY_RECURSION, and NO_RECURSION.
Referenced by create_file_list_tests(), and profile_spec::generate_file_list().
static string erase_trailing_path_separator | ( | string const & | path_name | ) | [static] |
path_name | the path where we remove trailing '/' |
erase all trailing '/' in path_name except if the last '/' is at pos 0
Definition at line 134 of file file_manip.cpp.
Referenced by op_basename(), and op_dirname().
static void get_pathname | ( | const char * | pathname, | |
void * | name_list | |||
) | [static] |
Definition at line 112 of file file_manip.cpp.
Referenced by create_file_list().
bool is_directory | ( | string const & | dirname | ) |
Definition at line 77 of file file_manip.cpp.
Referenced by is_directory_tests().
bool is_files_identical | ( | string const & | file1, | |
string const & | file2 | |||
) |
Definition at line 84 of file file_manip.cpp.
Referenced by is_files_identical_tests().
string op_basename | ( | string const & | path_name | ) |
Definition at line 170 of file file_manip.cpp.
References erase_to_last_of(), and erase_trailing_path_separator().
Referenced by __handle_mmap_event(), debug_name_storage::basename(), image_name_storage::basename(), basename_tests(), operf_process_info::connect_forked_process_to_parent(), daemon_status::daemon_status(), image_name_storage::get_name(), and operf_process_info::operf_process_info().
string op_dirname | ( | string const & | file_name | ) |
Definition at line 147 of file file_manip.cpp.
References erase_trailing_path_separator().
Referenced by dirname_tests(), and find_separate_debug_file().
bool op_file_readable | ( | string const & | file | ) |
Definition at line 107 of file file_manip.cpp.
References op_file_readable().
string const op_realpath | ( | string const & | name | ) |
Definition at line 98 of file file_manip.cpp.
Referenced by daemon_status::daemon_status(), profile_spec::generate_file_list(), and realpath_tests().