#include <cerrno>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <vector>
#include "canonicalize-file-name-wrapper.h"
#include "areadlink-wrapper.h"
#include "dir-ops.h"
#include "file-ops.h"
#include "file-stat.h"
#include "gen-tempname-wrapper.h"
#include "lo-sysdep.h"
#include "oct-env.h"
#include "oct-locbuf.h"
#include "oct-password.h"
#include "quit.h"
#include "stat-wrappers.h"
#include "str-vec.h"
#include "unistd-wrappers.h"
Go to the source code of this file.
Functions | |
std::string | canonicalize_file_name (const std::string &name) |
std::string | canonicalize_file_name (const std::string &name, std::string &msg) |
std::string | concat (const std::string &dir, const std::string &file) |
char | dev_sep_char (void) |
char | dir_sep_char (void) |
std::string | dir_sep_chars (void) |
std::string | dir_sep_str (void) |
std::string | dirname (const std::string &path) |
bool | is_dev_sep (char c) |
bool | is_dir_sep (char c) |
static std::string | isolate_tilde_prefix (const std::string &fname) |
int | link (const std::string &old_name, const std::string &new_name) |
int | link (const std::string &old_name, const std::string &new_name, std::string &msg) |
int | mkdir (const std::string &name, mode_t mode, std::string &msg) |
int | mkdir (const std::string &nm, mode_t md) |
int | mkfifo (const std::string &name, mode_t mode, std::string &msg) |
int | mkfifo (const std::string &nm, mode_t md) |
std::string | native_separator_path (const std::string &path) |
int | readlink (const std::string &path, std::string &result) |
int | readlink (const std::string &path, std::string &result, std::string &msg) |
int | recursive_mkdir (const std::string &name, mode_t mode) |
int | recursive_mkdir (const std::string &name, mode_t mode, std::string &msg) |
int | recursive_rmdir (const std::string &name) |
int | recursive_rmdir (const std::string &name, std::string &msg) |
int | rename (const std::string &from, const std::string &to) |
int | rename (const std::string &from, const std::string &to, std::string &msg) |
int | rmdir (const std::string &name) |
int | rmdir (const std::string &name, std::string &msg) |
int | symlink (const std::string &old_name, const std::string &new_name) |
int | symlink (const std::string &old_name, const std::string &new_name, std::string &msg) |
std::string | tail (const std::string &path) |
std::string | tempnam (const std::string &dir, const std::string &pfx) |
std::string | tempnam (const std::string &dir, const std::string &pfx, std::string &msg) |
std::string | tilde_expand (const std::string &name) |
string_vector | tilde_expand (const string_vector &names) |
static std::string | tilde_expand_word (const std::string &filename) |
static std::size_t | tilde_find_prefix (const std::string &s, std::size_t &len) |
static std::size_t | tilde_find_suffix (const std::string &s) |
int | umask (mode_t mode) |
int | unlink (const std::string &name) |
int | unlink (const std::string &name, std::string &msg) |
Variables | |
static const char * | default_prefixes [] = { " ~", "\t~", ":~", nullptr } |
static const char * | default_suffixes [] = { " ", "\n", ":", nullptr } |
string_vector | tilde_additional_prefixes = default_prefixes |
string_vector | tilde_additional_suffixes = default_suffixes |
tilde_expansion_hook | tilde_expansion_failure_hook = nullptr |
tilde_expansion_hook | tilde_expansion_preexpansion_hook = nullptr |
std::string canonicalize_file_name | ( | const std::string & | name | ) |
Definition at line 744 of file file-ops.cc.
Referenced by octave_dld_function::octave_dld_function(), octave_mex_function::octave_mex_function(), symbol_scope_rep::cache_dir_name(), Faudioinfo(), Fcanonicalize_file_name(), Fdbstatus(), get_ASCII_filename(), load_path::dir_info::initialize(), fcn_info::fcn_info_rep::load_private_function(), octave_user_function::mark_as_system_fcn_file(), maybe_canonicalize(), octave_canonicalize_file_name_wrapper(), hdf5_fstreambase::open_create(), load_path::read_dir_config(), file_editor_tab::save_file(), tree_evaluator::source_file(), load_path::dir_info::update(), and latex_renderer::write_tex_file().
std::string canonicalize_file_name | ( | const std::string & | name, |
std::string & | msg | ||
) |
Definition at line 750 of file file-ops.cc.
References dir_sep_chars(), free(), len, octave_canonicalize_file_name_wrapper(), u8_from_wstring(), and u8_to_wstring().
std::string concat | ( | const std::string & | dir, |
const std::string & | file | ||
) |
Definition at line 351 of file file-ops.cc.
References dir_sep_char(), and is_dir_sep().
char dev_sep_char | ( | void | ) |
Definition at line 222 of file file-ops.cc.
Referenced by is_dev_sep().
char dir_sep_char | ( | void | ) |
Definition at line 231 of file file-ops.cc.
Referenced by concat(), native_separator_path(), and tempnam().
std::string dir_sep_chars | ( | void | ) |
Definition at line 249 of file file-ops.cc.
References dir_sep_str().
Referenced by canonicalize_file_name(), dirname(), is_dir_sep(), recursive_mkdir(), and tail().
std::string dir_sep_str | ( | void | ) |
Definition at line 240 of file file-ops.cc.
Referenced by documentation::documentation(), documentation_browser::documentation_browser(), tree_evaluator::check_autoload_file(), history_system::default_file(), dir_sep_chars(), ft_manager::do_get_font(), env::do_get_home_directory(), env::do_get_user_config_directory(), env::do_get_user_data_directory(), env::do_make_absolute(), interpreter::execute_startup_files(), F__ftp_mget__(), F__parse_file__(), Ffilesep(), load_path::find_dir(), load_path::find_matching_dirs(), find_private_file(), Ftempdir(), get_ASCII_filename(), get_help_from_file(), initial_class_path(), initial_java_dir(), initialize_jvm(), load_fcn_from_file(), base_url_transfer::mget_directory(), base_url_transfer::mput_directory(), load_path::read_dir_config(), recursive_rmdir(), tree_evaluator::source_file(), and xzip().
std::string dirname | ( | const std::string & | path | ) |
Definition at line 360 of file file-ops.cc.
References dir_sep_chars().
Referenced by bp_file_info::bp_file_info(), FileDialog::FileDialog(), F__mkdir__(), Fcd(), Fdrawnow(), Fgenpath(), event_manager::file_dialog(), qt_interpreter_events::file_dialog(), QUIWidgetCreator::file_dialog(), scoped_fcn_handle::find_function(), Freaddir(), Frmdir(), genpath(), get_dirlist(), QUIWidgetCreator::handle_create_filedialog(), and tilde_expand_word().
bool is_dev_sep | ( | char | c | ) |
Definition at line 266 of file file-ops.cc.
References dev_sep_char().
bool is_dir_sep | ( | char | c | ) |
Definition at line 277 of file file-ops.cc.
References dir_sep_chars().
Referenced by concat(), isolate_tilde_prefix(), recursive_mkdir(), tilde_expand_word(), and tilde_find_suffix().
|
static |
Definition at line 142 of file file-ops.cc.
References is_dir_sep(), and len.
Referenced by tilde_expand_word().
int link | ( | const std::string & | old_name, |
const std::string & | new_name | ||
) |
Definition at line 491 of file file-ops.cc.
Referenced by documentation::documentation(), Flink(), and octave_link_wrapper().
int link | ( | const std::string & | old_name, |
const std::string & | new_name, | ||
std::string & | msg | ||
) |
Definition at line 497 of file file-ops.cc.
References octave_link_wrapper().
int mkdir | ( | const std::string & | name, |
mode_t | mode, | ||
std::string & | msg | ||
) |
Definition at line 408 of file file-ops.cc.
References octave_mkdir_wrapper().
int mkdir | ( | const std::string & | nm, |
mode_t | md | ||
) |
Definition at line 402 of file file-ops.cc.
Referenced by F__mkdir__(), get_ASCII_filename(), base_url_transfer::mget_directory(), octave_mkdir_wrapper(), recursive_mkdir(), latex_renderer::write_tex_file(), and xzip().
int mkfifo | ( | const std::string & | name, |
mode_t | mode, | ||
std::string & | msg | ||
) |
Definition at line 479 of file file-ops.cc.
References octave_mkfifo_wrapper().
int mkfifo | ( | const std::string & | nm, |
mode_t | md | ||
) |
Definition at line 473 of file file-ops.cc.
Referenced by Fmkfifo(), and octave_mkfifo_wrapper().
std::string native_separator_path | ( | const std::string & | path | ) |
Definition at line 379 of file file-ops.cc.
References dir_sep_char(), and n.
Referenced by F__fltk_uigetfile__().
int readlink | ( | const std::string & | path, |
std::string & | result | ||
) |
Definition at line 533 of file file-ops.cc.
Referenced by Freadlink().
int readlink | ( | const std::string & | path, |
std::string & | result, | ||
std::string & | msg | ||
) |
Definition at line 539 of file file-ops.cc.
References free(), and octave_areadlink_wrapper().
int recursive_mkdir | ( | const std::string & | name, |
mode_t | mode | ||
) |
Definition at line 420 of file file-ops.cc.
int recursive_mkdir | ( | const std::string & | name, |
mode_t | mode, | ||
std::string & | msg | ||
) |
Definition at line 426 of file file-ops.cc.
References dir_sep_chars(), is_dir_sep(), and mkdir().
int recursive_rmdir | ( | const std::string & | name | ) |
Definition at line 608 of file file-ops.cc.
Referenced by documentation::~documentation(), latex_renderer::~latex_renderer(), Frmdir(), and recursive_rmdir().
int recursive_rmdir | ( | const std::string & | name, |
std::string & | msg | ||
) |
Definition at line 614 of file file-ops.cc.
References dir_sep_str(), base_file_stat::error(), get_dirlist(), base_file_stat::is_dir(), string_vector::numel(), recursive_rmdir(), rmdir(), and unlink().
int rename | ( | const std::string & | from, |
const std::string & | to | ||
) |
Definition at line 559 of file file-ops.cc.
Referenced by workspace_view::contextmenu_requested(), Frename(), hdf5_fstreambase::open_create(), and rename().
int rename | ( | const std::string & | from, |
const std::string & | to, | ||
std::string & | msg | ||
) |
Definition at line 565 of file file-ops.cc.
References rename(), and u8_to_wstring().
int rmdir | ( | const std::string & | name | ) |
Definition at line 586 of file file-ops.cc.
Referenced by Frmdir(), octave_rmdir_wrapper(), and recursive_rmdir().
int rmdir | ( | const std::string & | name, |
std::string & | msg | ||
) |
Definition at line 592 of file file-ops.cc.
References octave_rmdir_wrapper().
int symlink | ( | const std::string & | old_name, |
const std::string & | new_name | ||
) |
Definition at line 512 of file file-ops.cc.
Referenced by Freadlink(), Fsymlink(), and octave_symlink_wrapper().
int symlink | ( | const std::string & | old_name, |
const std::string & | new_name, | ||
std::string & | msg | ||
) |
Definition at line 518 of file file-ops.cc.
References octave_symlink_wrapper().
std::string tail | ( | const std::string & | path | ) |
Definition at line 367 of file file-ops.cc.
References dir_sep_chars().
Referenced by bp_file_info::bp_file_info().
std::string tempnam | ( | const std::string & | dir, |
const std::string & | pfx | ||
) |
Definition at line 697 of file file-ops.cc.
Referenced by documentation::documentation(), Ftempname(), Ftmpfile(), mk_tmp_hist_file(), hdf5_fstreambase::open_create(), and latex_renderer::write_tex_file().
std::string tempnam | ( | const std::string & | dir, |
const std::string & | pfx, | ||
std::string & | msg | ||
) |
Definition at line 703 of file file-ops.cc.
References dir_sep_char(), env::get_temp_directory(), and octave_gen_tempname_wrapper().
std::string tilde_expand | ( | const std::string & | name | ) |
Definition at line 283 of file file-ops.cc.
References len, tilde_expand_word(), tilde_find_prefix(), and tilde_find_suffix().
Referenced by load_path::add(), interpreter::chdir(), chdir(), do_stream_open(), F__fnmatch__(), F__ftp_mput__(), F__mkdir__(), F__parse_file__(), F__wglob__(), Fdlmread(), Fglob(), load_path::find_dir_info(), Flink(), Freaddir(), Freadlink(), Frename(), Frmdir(), Fsymlink(), Ftilde_expand(), initial_class_path(), load_save_system::load(), dir_entry::open(), read_classpath_txt(), command_editor::read_init_file(), load_path::remove(), load_save_system::save(), command_history::set_file(), tree_evaluator::source_file(), tilde_expand(), file_stat::update_internal(), and xzip().
string_vector tilde_expand | ( | const string_vector & | names | ) |
Definition at line 339 of file file-ops.cc.
References n, string_vector::numel(), and tilde_expand().
|
static |
Definition at line 158 of file file-ops.cc.
References dirname(), is_dir_sep(), isolate_tilde_prefix(), tilde_expansion_failure_hook, and tilde_expansion_preexpansion_hook.
Referenced by tilde_expand().
|
static |
Definition at line 76 of file file-ops.cc.
References string_vector::empty(), len, string_vector::numel(), and tilde_additional_prefixes.
Referenced by tilde_expand().
|
static |
Definition at line 111 of file file-ops.cc.
References string_vector::empty(), is_dir_sep(), string_vector::numel(), and tilde_additional_suffixes.
Referenced by tilde_expand().
int umask | ( | mode_t | mode | ) |
Definition at line 672 of file file-ops.cc.
References octave_umask_wrapper().
Referenced by Fumask(), and octave_umask_wrapper().
int unlink | ( | const std::string & | name | ) |
Definition at line 677 of file file-ops.cc.
Referenced by history_system::do_edit_history(), history_system::do_run_history(), F__ftp_mget__(), Funlink(), Furlwrite(), get_ASCII_filename(), base_url_transfer::mget_directory(), octave_unlink_wrapper(), recursive_rmdir(), and xzip().
int unlink | ( | const std::string & | name, |
std::string & | msg | ||
) |
Definition at line 683 of file file-ops.cc.
References octave_unlink_wrapper().
|
static |
Definition at line 68 of file file-ops.cc.
|
static |
Definition at line 73 of file file-ops.cc.
string_vector tilde_additional_prefixes = default_prefixes |
Definition at line 262 of file file-ops.cc.
Referenced by tilde_find_prefix().
string_vector tilde_additional_suffixes = default_suffixes |
Definition at line 264 of file file-ops.cc.
Referenced by tilde_find_suffix().
tilde_expansion_hook tilde_expansion_failure_hook = nullptr |
Definition at line 260 of file file-ops.cc.
Referenced by tilde_expand_word().
tilde_expansion_hook tilde_expansion_preexpansion_hook = nullptr |
Definition at line 258 of file file-ops.cc.
Referenced by tilde_expand_word().