GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
dirfns.cc File Reference
#include <cerrno>
#include <cstdio>
#include <cstddef>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <string>
#include "file-ops.h"
#include "file-stat.h"
#include "glob-match.h"
#include "oct-env.h"
#include "oct-glob.h"
#include "pathsearch.h"
#include "str-vec.h"
#include "Cell.h"
#include "defun.h"
#include "dir-ops.h"
#include "dirfns.h"
#include "error.h"
#include "errwarn.h"
#include "input.h"
#include "load-path.h"
#include "octave.h"
#include "octave-link.h"
#include "ovl.h"
#include "pager.h"
#include "procstream.h"
#include "sysdep.h"
#include "interpreter-private.h"
#include "interpreter.h"
#include "unwind-prot.h"
#include "utils.h"
#include "variables.h"
Include dependency graph for dirfns.cc:

Go to the source code of this file.

Functions

OCTAVE_EXPORT octave_value_list Fcd (const octave_value_list &args, int nargout) the current directory is changed to the user 's home directory(@qcode
 
OCTAVE_EXPORT octave_value_list Fpwd (const octave_value_list &, int) dir
 
OCTAVE_EXPORT octave_value_list rmdir nd deftypefn *OCTAVE_EXPORT octave_value_list Freaddir (const octave_value_list &args, int) ar
 
static int octave_change_to_directory (const std::string &newdir)
 

Variables

 ar
 
For example cd octave end example noindent changes the current working directory to an error message is printed and the working directory is not changed code {chdir} is an alias for @code{cd} and can be used in all of the same calling formats. Compatibility Note: When called with no arguments
 
For example
 
For example cd octave end example noindent changes the current working directory to file {~/octave}. If the directory does not exist
 
OCTAVE_EXPORT octave_value_list ls
 
OCTAVE_EXPORT octave_value_list mkdir
 
For example cd octave end example noindent changes the current working directory to an error message is printed and the working directory is not changed sc
 
static bool Vconfirm_recursive_rmdir = true
 
octave::sys::time Vlast_chdir_time = 0.0
 

Function Documentation

◆ Fcd()

OCTAVE_EXPORT octave_value_list Fcd ( const octave_value_list args,
int  nargout 
)

Definition at line 124 of file dirfns.cc.

Referenced by octave::main_window::change_directory_callback().

◆ Fpwd()

OCTAVE_EXPORT octave_value_list Fpwd ( const octave_value_list ,
int   
)

◆ Freaddir()

◆ octave_change_to_directory()

Variable Documentation

◆ ar

ar

Definition at line 179 of file dirfns.cc.

◆ code

For example cd octave end example noindent changes the current working directory to an error message is printed and the working directory is not changed code {chdir} is an alias for @code{cd} and can be used in all of the same calling formats. Compatibility Note: When called with no arguments

Definition at line 124 of file dirfns.cc.

◆ example

For example

Definition at line 124 of file dirfns.cc.

◆ file

tem check only for symbols of the specified type Valid types are table asis item and there are multiple possible matches for built in oct file {~/octave}. If the directory does not exist

Definition at line 124 of file dirfns.cc.

Referenced by octave::tree_statement_list::add_breakpoint(), octave::bp_table::add_breakpoint_1(), octave::call_stack::backtrace(), octave::help_system::built_in_docstrings_file(), octave::external_editor_interface::call_custom_editor(), octave::file_editor_tab::check_file_modified(), check_gzip_magic(), octave::file_editor_tab::check_valid_identifier(), octave::sys::file_ops::concat(), octave::files_dock_widget::contextmenu_open(), octave::files_dock_widget::contextmenu_open_in_editor(), QtHandles::Figure::copy_figure_callback(), octave::main_window::copy_image_to_clipboard(), octave_link::copy_image_to_clipboard(), octave_link::debug_cd_or_addpath_error(), default_history_file(), octave::url_transfer::del(), octave::curl_transfer::del(), octave::base_url_transfer::delete_file(), delete_file(), octave::main_window::display_release_notes(), do_edit_history(), octave::ft_manager::do_get_font(), octave::shortcut_manager::do_import_export(), octave::resource_manager::do_set_settings(), octave::help_system::doc_cache_file(), dump_octave_core(), octave::tree_evaluator::echo(), octave::tree_evaluator::echo_this_file(), QTerminal::edit_file(), octave_link::edit_file(), QtHandles::Figure::editCopy(), octave_link::enter_debugger_event(), err_file_open(), octave_link::execute_in_debugger_event(), execute_pkg_add_or_del(), octave::sys::execvp(), F__ftp_delete__(), F__ftp_mget__(), F__ftp_mput__(), F__octave_link_edit_file__(), F__octave_link_register_doc__(), F__octave_link_show_doc__(), F__octave_link_unregister_doc__(), F__open_with_system_app__(), octave::dynamic_library::dynlib_rep::fake_reload(), octave::dynamic_library::dynlib_rep::file_name(), QtHandles::Figure::fileSaveFigure(), octave::load_path::find_all_first_of(), octave::load_path::find_file(), octave::load_path::find_first_of(), octave::file_editor::find_tab_widget(), G__osmesa_print__(), Gaudioread(), octave::url_transfer::get(), octave::curl_transfer::get(), get_file_format(), gripe_data_file_in_path(), octave::main_window::handle_delete_debugger_pointer_request(), octave::file_editor::handle_delete_debugger_pointer_request(), octave::external_editor_interface::handle_edit_file_request(), octave::file_editor::handle_edit_file_request(), octave::main_window::handle_edit_mfile_request(), octave::main_window::handle_insert_debugger_pointer_request(), octave::file_editor::handle_insert_debugger_pointer_request(), octave::main_window::handle_load_workspace_request(), octave::main_window::handle_register_doc(), octave::main_window::handle_save_workspace_request(), octave::main_window::handle_show_doc(), octave::main_window::handle_unregister_doc(), octave::main_window::handle_update_breakpoint_marker_request(), octave::file_editor::handle_update_breakpoint_marker_request(), QTerminal::handleCustomContextMenuRequested(), if(), octave::help_system::info_file(), octave::help_system::info_program(), install_builtin_function(), octave::find_files_dialog::is_match(), octave::sys::base_file_stat::is_newer(), octave::dynamic_library::dynlib_rep::is_out_of_date(), octave::file_editor_tab::load_file(), octave::main_window::load_workspace_callback(), main(), octave::help_system::makeinfo_program(), mark_for_deletion(), mk_tmp_hist_file(), octave::base_url_transfer::mput_directory(), octave_exec(), octave_execv_wrapper(), octave_execvp_wrapper(), octave::files_dock_widget::open_item_in_app(), octave::out_of_date_check(), gnuplot_graphics_toolkit::print_figure(), graphics_toolkit::print_figure(), octave::files_dock_widget::process_new_file(), octave_link::prompt_new_edit_file(), octave::url_transfer::put(), octave::curl_transfer::put(), octave::command_editor::read_init_file(), octave_link::register_doc(), octave::tree_statement_list::remove_all_breakpoints(), octave::bp_table::remove_all_breakpoints_in_file(), octave::bp_table::remove_breakpoint_1(), octave::file_editor::request_open_file(), UrlFilter::request_open_file(), FilterObject::request_open_file(), octave::file_editor::restore_session(), octave::variable_editor_stack::save(), QtHandles::Figure::save_figure_callback(), octave::file_editor_tab::save_file(), octave::main_window::save_workspace_callback(), octave::resource_manager::set_settings(), octave_link::show_doc(), single_match_exists(), octave::file_info::snarf_file(), sparse_chol_error_internal(), SparseCholError(), octave_builtin::src_file_name(), octave::tree_anon_fcn_handle::stash_file_name(), octave::help_system::texi_macros_file(), unlink_cleanup(), octave_link::unregister_doc(), octave_link::update_breakpoint(), octave::file_editor_tab::update_window_title(), octave::file_editor_tab::valid_file_name(), warn_data_file_in_path(), octave::documentation::~documentation(), and octave::dynamic_library::dynlib_rep::~dynlib_rep().

◆ ls

OCTAVE_EXPORT octave_value_list ls

Definition at line 162 of file dirfns.cc.

◆ mkdir

OCTAVE_EXPORT octave_value_list mkdir

Definition at line 162 of file dirfns.cc.

Referenced by octave_mkdir_wrapper().

◆ sc

For example cd octave end example noindent changes the current working directory to an error message is printed and the working directory is not changed sc
Initial value:
{matlab} prints the present working directory rather than changing to the user's home directory. eealso{pwd, mkdir, rmdir, dir, ls} nd deftypefn */)
{
int nargin = args.length ();
if (nargin > 1)
print_usage ();
octave_value_list retval;
if (nargout > 0)
retval = octave_value (octave::sys::env::get_current_directory ());
if (nargin == 1)
{
std::string dirname = args(0).xstring_value ("cd: DIR must be a string");
if (! dirname.empty ())
octave_change_to_directory (dirname);
}
else
{
std::string home_dir = octave::sys::env::get_home_directory ();
if (! home_dir.empty ())
octave_change_to_directory (home_dir);
}
return retval;
}
OCTAVE_EXPORT octave_value_list directory
Definition: variables.cc:593

Definition at line 124 of file dirfns.cc.

Referenced by octave::shortcut_manager::do_fill_treewidget(), octave::shortcut_manager::import_shortcuts(), QTerminal::notice_settings(), and octave::tree_classdef_superclass_list::tree_classdef_superclass_list().

◆ Vconfirm_recursive_rmdir

bool Vconfirm_recursive_rmdir = true
static

Definition at line 66 of file dirfns.cc.

◆ Vlast_chdir_time

octave::sys::time Vlast_chdir_time = 0.0

Definition at line 69 of file dirfns.cc.

Referenced by octave_change_to_directory(), and octave::out_of_date_check().