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 ==
"\\")
217 #if defined (P_tmpdir)
252 return ! display.empty ();
265 static bool initialized =
false;
303 size_t len = home_dir.length ();
305 if (len > 1 && home_dir == name.substr (0, len)
309 retval.append (name.substr (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;
536 return value ? value :
"";
561 size_t len = tmp.length ();
589 size_t i = path.length () - 1;
608 (*current_liboctave_error_handler) (
"%s", std::strerror (err_num));
614 (*current_liboctave_error_handler) (
"%s", s.c_str ());
std::string do_polite_directory_format(const std::string &name) const
static std::string dir_sep_str(void)
static std::string get_current_directory(void)
std::string do_get_user_name(void) const
Octave interface to the compression and uncompression libraries.
void octave_putenv(const std::string &name, const std::string &value)
static void putenv(const std::string &name, const std::string &value)
static bool chdir(const std::string &newdir)
static std::string dir_sep_chars(void)
std::string do_getenv(const std::string &name) const
static char * strsave(const char *s)
std::string current_directory
static password getpwuid(uid_t uid)
void do_set_program_name(const std::string &s) const
static bool rooted_relative_pathname(const std::string &s)
bool do_rooted_relative_pathname(const std::string &s) const
bool follow_symbolic_links
static std::string getenv(const std::string &name)
static bool instance_ok(void)
std::string do_get_home_directory(void) const
std::string do_base_pathname(const std::string &s) const
static std::string make_absolute(const std::string &s, const std::string &dot_path=get_current_directory())
std::string dir(void) const
static std::string get_home_directory(void)
static std::string get_temp_directory(void)
std::string name(void) const
static std::string get_host_name(void)
static std::string get_user_name(void)
static bool absolute_pathname(const std::string &s)
bool do_absolute_pathname(const std::string &s) const
std::string do_get_temp_directory(void) const
static std::string base_pathname(const std::string &s)
static void cleanup_instance(void)
bool do_chdir(const std::string &newdir)
void pathname_backup(std::string &path, int n) const
=val(i)}if ode{val(i)}occurs in table i
static void set_program_name(const std::string &s)
std::string prog_invocation_name
OCTAVE_EXPORT octave_value_list or N dimensional array whose elements are all equal to the IEEE symbol zero divided by nd tex zero divided by nd ifnottex and any operation involving another NaN value(5+NaN).Note that NaN always compares not equal to NaN(NaN!
int octave_gethostname_wrapper(char *nm, size_t len)
int chdir(const std::string &path_arg)
std::string do_getcwd(void) const
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
std::string do_make_absolute(const std::string &s, const std::string &dot_path) const
std::string do_get_host_name(void) const
static bool is_dir_sep(char c)
static std::string polite_directory_format(const std::string &name)