39 #if defined (HAVE_CONFIG_H) 65 : follow_symbolic_links (true), verbatim_pwd (true),
66 current_directory (), prog_name (), prog_invocation_name (),
67 user_name (), host_name ()
94 (*current_liboctave_error_handler)
95 (
"unable to create current working directory object!");
196 #if defined (__MINGW32__) || defined (_MSC_VER) 203 #if defined (P_tmpdir) 210 if (tempd.empty () || tempd == R
"(\)") 211 tempd = R"(c:\temp)"; 217 #if defined (P_tmpdir) 252 return ! display.empty ();
303 size_t len = home_dir.length ();
305 if (len > 1 && home_dir ==
name.substr (0, len)
320 size_t len =
s.length ();
328 #if defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) 329 if ((len == 2 && isalpha (
s[0]) &&
s[1] ==
':')
330 || (len > 2 && isalpha (
s[0]) &&
s[1] ==
':' 341 size_t len =
s.length ();
346 if (len == 1 &&
s[0] ==
'.')
352 if (len == 2 &&
s[0] ==
'.' &&
s[1] ==
'.')
355 if (len > 2 &&
s[0] ==
'.' &&
s[1] ==
'.' 374 if (pos == std::string::npos)
377 return s.substr (pos+1);
401 size_t slen =
s.length ();
433 if (sep_pos == std::string::npos)
435 current_dir.append (
s,
i, sep_pos-
i);
438 else if (sep_pos ==
i)
445 current_dir.append (
s,
i, sep_pos-
i+1);
452 current_dir.pop_back ();
479 #if defined (__MINGW32__) || defined (_MSC_VER) 525 host_name = (status < 0) ?
"unknown" : hostname;
583 size_t i = path.length () - 1;
602 (*current_liboctave_error_handler) (
"%s", std::strerror (err_num));
608 (*current_liboctave_error_handler) (
"%s",
s.c_str ());
void pathname_backup(std::string &path, int n) const
static std::string get_current_directory(void)
void octave_putenv(const std::string &name, const std::string &value)
bool do_absolute_pathname(const std::string &s) const
static void putenv(const std::string &name, const std::string &value)
std::string dir(void) const
static bool chdir(const std::string &newdir)
std::string dir_sep_chars(void)
std::string do_make_absolute(const std::string &s, const std::string &dot_path) const
void do_set_program_name(const std::string &s) const
std::string do_getenv(const std::string &name) const
std::string current_directory
static password getpwuid(uid_t uid)
static bool rooted_relative_pathname(const std::string &s)
std::string do_get_user_name(void) const
bool follow_symbolic_links
std::string dir_sep_str(void)
static std::string getenv(const std::string &name)
static bool instance_ok(void)
static std::string make_absolute(const std::string &s, const std::string &dot_path=get_current_directory())
nd deftypefn *std::string name
static std::string get_home_directory(void)
static std::string get_temp_directory(void)
bool do_rooted_relative_pathname(const std::string &s) const
static std::string get_host_name(void)
static std::string get_user_name(void)
static bool absolute_pathname(const std::string &s)
std::string do_get_home_directory(void) const
std::string do_getcwd(void) const
static std::string base_pathname(const std::string &s)
static void cleanup_instance(void)
bool do_chdir(const std::string &newdir)
std::string name(void) const
std::string do_base_pathname(const std::string &s) const
static char * strsave(const char *s)
std::string do_polite_directory_format(const std::string &name) const
static void set_program_name(const std::string &s)
std::string prog_invocation_name
std::string do_get_host_name(void) const
int octave_gethostname_wrapper(char *nm, size_t len)
int chdir(const std::string &path_arg)
static bool have_x11_display(void)
static std::string get_program_invocation_name(void)
static std::string get_program_name(void)
const char * octave_set_program_name_wrapper(const char *pname)
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
nd group nd example For each display the value
std::string do_get_temp_directory(void) const
static std::string polite_directory_format(const std::string &name)