GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
dirfns.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1994-2017 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if defined (HAVE_CONFIG_H)
24 # include "config.h"
25 #endif
26 
27 #include <cerrno>
28 #include <cstdio>
29 #include <cstddef>
30 #include <cstdlib>
31 #include <cstring>
32 
33 #include <sstream>
34 #include <string>
35 
36 #include "file-ops.h"
37 #include "file-stat.h"
38 #include "glob-match.h"
39 #include "oct-env.h"
40 #include "oct-glob.h"
41 #include "pathsearch.h"
42 #include "str-vec.h"
43 
44 #include "Cell.h"
45 #include "defun.h"
46 #include "dir-ops.h"
47 #include "dirfns.h"
48 #include "error.h"
49 #include "errwarn.h"
50 #include "input.h"
51 #include "load-path.h"
52 #include "octave.h"
53 #include "octave-link.h"
54 #include "ovl.h"
55 #include "pager.h"
56 #include "procstream.h"
57 #include "sysdep.h"
58 #include "interpreter.h"
59 #include "unwind-prot.h"
60 #include "utils.h"
61 #include "variables.h"
62 
63 // TRUE means we ask for confirmation before recursively removing a
64 // directory tree.
65 static bool Vconfirm_recursive_rmdir = true;
66 
67 // The time we last time we changed directories.
69 
70 static int
72 {
74 
75  int cd_ok = octave::sys::env::chdir (xdir);
76 
77  if (! cd_ok)
78  error ("%s: %s", newdir.c_str (), std::strerror (errno));
79 
80  Vlast_chdir_time.stamp ();
81 
82  // FIXME: should these actions be handled as a list of functions
83  // to call so users can add their own chdir handlers?
84 
86 
88 
89  return cd_ok;
90 }
91 
92 DEFUN (cd, args, nargout,
93  doc: /* -*- texinfo -*-
94 @deftypefn {} {} cd @var{dir}
95 @deftypefnx {} {} cd
96 @deftypefnx {} {@var{old_dir} =} cd (@var{dir})
97 @deftypefnx {} {} chdir @dots{}
98 Change the current working directory to @var{dir}.
99 
100 If @var{dir} is omitted, the current directory is changed to the user's home
101 directory (@qcode{"~"}).
102 
103 For example,
104 
105 @example
106 cd ~/octave
107 @end example
108 
109 @noindent
110 changes the current working directory to @file{~/octave}. If the
111 directory does not exist, an error message is printed and the working
112 directory is not changed.
113 
114 @code{chdir} is an alias for @code{cd} and can be used in all of the same
115 calling formats.
116 
117 Compatibility Note: When called with no arguments, @sc{matlab} prints the
118 present working directory rather than changing to the user's home directory.
119 @seealso{pwd, mkdir, rmdir, dir, ls}
120 @end deftypefn */)
121 {
122  int nargin = args.length ();
123 
124  if (nargin > 1)
125  print_usage ();
126 
128 
129  if (nargout > 0)
131 
132  if (nargin == 1)
133  {
134  std::string dirname = args(0).xstring_value ("cd: DIR must be a string");
135 
136  if (! dirname.empty ())
137  octave_change_to_directory (dirname);
138  }
139  else
140  {
142 
143  if (! home_dir.empty ())
144  octave_change_to_directory (home_dir);
145  }
146 
147  return retval;
148 }
149 
150 DEFALIAS (chdir, cd);
151 
152 DEFUN (pwd, , ,
153  doc: /* -*- texinfo -*-
154 @deftypefn {} {} pwd ()
155 @deftypefnx {} {@var{dir} =} pwd ()
156 Return the current working directory.
157 @seealso{cd, dir, ls, mkdir, rmdir}
158 @end deftypefn */)
159 {
161 }
162 
163 DEFUN (readdir, args, ,
164  doc: /* -*- texinfo -*-
165 @deftypefn {} {@var{files} =} readdir (@var{dir})
166 @deftypefnx {} {[@var{files}, @var{err}, @var{msg}] =} readdir (@var{dir})
167 Return the names of files in the directory @var{dir} as a cell array of
168 strings.
169 
170 If an error occurs, return an empty cell array in @var{files}.
171 If successful, @var{err} is 0 and @var{msg} is an empty string.
172 Otherwise, @var{err} is nonzero and @var{msg} contains a system-dependent
173 error message.
174 @seealso{ls, dir, glob, what}
175 @end deftypefn */)
176 {
177  if (args.length () != 1)
178  print_usage ();
179 
180  std::string dirname = args(0).xstring_value ("readdir: DIR must be a string");
181 
182  octave_value_list retval = ovl (Cell (), -1.0, "");
183 
184  dirname = octave::sys::file_ops::tilde_expand (dirname);
185 
186  octave::sys::dir_entry dir (dirname);
187 
188  if (dir)
189  {
190  string_vector dirlist = dir.read ();
191  retval(0) = Cell (dirlist.sort ());
192  retval(1) = 0.0;
193  }
194  else
195  retval(2) = dir.error ();
196 
197  return retval;
198 }
199 
200 // FIXME: should maybe also allow second arg to specify mode?
201 // OTOH, that might cause trouble with compatibility later...
202 
203 DEFUN (__mkdir__, args, ,
204  doc: /* -*- texinfo -*-
205 @deftypefn {} {} __mkdir__ (@var{parent}, @var{dir})
206 Internal function called by mkdir.m.
207 @seealso{mkdir, rmdir, pwd, cd, umask}
208 @end deftypefn */)
209 {
210  int nargin = args.length ();
211 
212  if (nargin < 1 || nargin > 2)
213  print_usage ("mkdir");
214 
215  std::string dirname;
216 
217  if (nargin == 2)
218  {
219  std::string parent = args(0).xstring_value ("mkdir: PARENT must be a string");
220  std::string dir = args(1).xstring_value ("mkdir: DIR must be a string");
221 
222  dirname = octave::sys::file_ops::concat (parent, dir);
223  }
224  else if (nargin == 1)
225  dirname = args(0).xstring_value ("mkdir: DIR must be a string");
226 
227  dirname = octave::sys::file_ops::tilde_expand (dirname);
228 
229  octave::sys::file_stat fs (dirname);
230 
231  if (fs && fs.is_dir ())
232  {
233  // For Matlab compatibility, return true when directory already exists.
234  return ovl (true, "directory exists", "mkdir");
235  }
236  else
237  {
238  std::string msg;
239 
240  int status = octave::sys::mkdir (dirname, 0777, msg);
241 
242  if (status < 0)
243  return ovl (false, msg, "mkdir");
244  else
245  return ovl (true, "", "");
246  }
247 }
248 
249 DEFUNX ("rmdir", Frmdir, args, ,
250  doc: /* -*- texinfo -*-
251 @deftypefn {} {} rmdir @var{dir}
252 @deftypefnx {} {} rmdir (@var{dir}, "s")
253 @deftypefnx {} {[@var{status}, @var{msg}, @var{msgid}] =} rmdir (@dots{})
254 Remove the directory named @var{dir}.
255 
256 If the optional second parameter is supplied with value @qcode{"s"},
257 recursively remove all subdirectories as well.
258 
259 If successful, @var{status} is 1, and @var{msg}, @var{msgid} are empty
260 character strings (""). Otherwise, @var{status} is 0, @var{msg} contains a
261 system-dependent error message, and @var{msgid} contains a unique message
262 identifier.
263 
264 @seealso{mkdir, confirm_recursive_rmdir, pwd}
265 @end deftypefn */)
266 {
267  int nargin = args.length ();
268 
269  if (nargin < 1 || nargin > 2)
270  print_usage ();
271 
272  std::string dirname = args(0).xstring_value ("rmdir: DIR must be a string");
273 
275  int status = -1;
276  std::string msg;
277 
278  if (nargin == 2)
279  {
280  if (args(1).string_value () != "s")
281  error ("rmdir: second argument must be \"s\" for recursive removal");
282 
283  bool doit = true;
284 
285  if (octave::application::interactive ()
286  && ! octave::application::forced_interactive ()
287  && Vconfirm_recursive_rmdir)
288  {
289  std::string prompt = "remove entire contents of " + fulldir + "? ";
290 
291  doit = octave_yes_or_no (prompt);
292  }
293 
294  if (doit)
295  status = octave::sys::recursive_rmdir (fulldir, msg);
296  }
297  else
298  status = octave::sys::rmdir (fulldir, msg);
299 
300  if (status < 0)
301  return ovl (false, msg, "rmdir");
302  else
303  return ovl (true, "", "");
304 }
305 
306 DEFUNX ("link", Flink, args, ,
307  doc: /* -*- texinfo -*-
308 @deftypefn {} {} link @var{old} @var{new}
309 @deftypefnx {} {[@var{err}, @var{msg}] =} link (@var{old}, @var{new})
310 Create a new link (also known as a hard link) to an existing file.
311 
312 If successful, @var{err} is 0 and @var{msg} is an empty string.
313 Otherwise, @var{err} is nonzero and @var{msg} contains a system-dependent
314 error message.
315 @seealso{symlink, unlink, readlink, lstat}
316 @end deftypefn */)
317 {
318  if (args.length () != 2)
319  print_usage ();
320 
321  std::string from = args(0).xstring_value ("link: OLD must be a string");
322  std::string to = args(1).xstring_value ("link: NEW must be a string");
323 
326 
327  std::string msg;
328 
329  int status = octave::sys::link (from, to, msg);
330 
331  if (status < 0)
332  return ovl (-1.0, msg);
333  else
334  return ovl (status, "");
335 }
336 
337 DEFUNX ("symlink", Fsymlink, args, ,
338  doc: /* -*- texinfo -*-
339 @deftypefn {} {} symlink @var{old} @var{new}
340 @deftypefnx {} {[@var{err}, @var{msg}] =} symlink (@var{old}, @var{new})
341 Create a symbolic link @var{new} which contains the string @var{old}.
342 
343 If successful, @var{err} is 0 and @var{msg} is an empty string.
344 Otherwise, @var{err} is nonzero and @var{msg} contains a system-dependent
345 error message.
346 @seealso{link, unlink, readlink, lstat}
347 @end deftypefn */)
348 {
349  if (args.length () != 2)
350  print_usage ();
351 
352  std::string from = args(0).xstring_value ("symlink: OLD must be a string");
353  std::string to = args(1).xstring_value ("symlink: NEW must be a string");
354 
357 
358  std::string msg;
359 
360  int status = octave::sys::symlink (from, to, msg);
361 
362  if (status < 0)
363  return ovl (-1.0, msg);
364  else
365  return ovl (status, "");
366 }
367 
368 DEFUNX ("readlink", Freadlink, args, ,
369  doc: /* -*- texinfo -*-
370 @deftypefn {} {} readlink @var{symlink}
371 @deftypefnx {} {[@var{result}, @var{err}, @var{msg}] =} readlink (@var{symlink})
372 Read the value of the symbolic link @var{symlink}.
373 
374 If successful, @var{result} contains the contents of the symbolic link
375 @var{symlink}, @var{err} is 0, and @var{msg} is an empty string.
376 Otherwise, @var{err} is nonzero and @var{msg} contains a system-dependent
377 error message.
378 @seealso{lstat, symlink, link, unlink, delete}
379 @end deftypefn */)
380 {
381  if (args.length () != 1)
382  print_usage ();
383 
384  std::string symlink = args(0).xstring_value ("readlink: SYMLINK must be a string");
385 
386  symlink = octave::sys::file_ops::tilde_expand (symlink);
387 
388  std::string result, msg;
389 
390  int status = octave::sys::readlink (symlink, result, msg);
391 
392  if (status < 0)
393  return ovl ("", -1.0, msg);
394  else
395  return ovl (result, status, "");
396 }
397 
398 DEFUNX ("rename", Frename, args, ,
399  doc: /* -*- texinfo -*-
400 @deftypefn {} {} rename @var{old} @var{new}
401 @deftypefnx {} {[@var{err}, @var{msg}] =} rename (@var{old}, @var{new})
402 Change the name of file @var{old} to @var{new}.
403 
404 If successful, @var{err} is 0 and @var{msg} is an empty string.
405 Otherwise, @var{err} is nonzero and @var{msg} contains a system-dependent
406 error message.
407 @seealso{movefile, copyfile, ls, dir}
408 @end deftypefn */)
409 {
410  if (args.length () != 2)
411  print_usage ();
412 
413  std::string from = args(0).xstring_value ("rename: OLD must be a string");
414  std::string to = args(1).xstring_value ("rename: NEW must be a string");
415 
418 
419  std::string msg;
420 
421  int status = octave::sys::rename (from, to, msg);
422 
423  if (status < 0)
424  return ovl (-1.0, msg);
425  else
426  return ovl (status, "");
427 }
428 
429 DEFUN (glob, args, ,
430  doc: /* -*- texinfo -*-
431 @deftypefn {} {} glob (@var{pattern})
432 Given an array of pattern strings (as a char array or a cell array) in
433 @var{pattern}, return a cell array of filenames that match any of
434 them, or an empty cell array if no patterns match.
435 
436 The pattern strings are interpreted as filename globbing patterns (as they
437 are used by Unix shells).
438 
439 Within a pattern
440 
441 @table @code
442 @item *
443 matches any string, including the null string,
444 
445 @item ?
446 matches any single character, and
447 
448 @item [@dots{}]
449 matches any of the enclosed characters.
450 @end table
451 
452 Tilde expansion is performed on each of the patterns before looking for
453 matching filenames. For example:
454 
455 @example
456 ls
457  @result{}
458  file1 file2 file3 myfile1 myfile1b
459 glob ("*file1")
460  @result{}
461  @{
462  [1,1] = file1
463  [2,1] = myfile1
464  @}
465 glob ("myfile?")
466  @result{}
467  @{
468  [1,1] = myfile1
469  @}
470 glob ("file[12]")
471  @result{}
472  @{
473  [1,1] = file1
474  [2,1] = file2
475  @}
476 @end example
477 @seealso{ls, dir, readdir, what}
478 @end deftypefn */)
479 {
480  if (args.length () != 1)
481  print_usage ();
482 
483  string_vector pat = args(0).xstring_vector_value ("glob: PATTERN must be a string");
484 
486 
487  return ovl (Cell (pattern.glob ()));
488 }
489 
490 
491 DEFUN (__wglob__, args, ,
492  doc: /* -*- texinfo -*-
493 @deftypefn {} {} __wglob__ (@var{pattern})
494 Windows-like glob for dir.
495 
496 Given an array of pattern strings (as a char array or a cell array) in
497 @var{pattern}, return a cell array of filenames that match any of
498 them, or an empty cell array if no patterns match.
499 
500 The pattern strings are interpreted as filename globbing patterns
501 (roughly as they are used by Windows dir).
502 
503 Within a pattern
504 
505 @table @code
506 @item *
507 matches any string, including the null string,
508 
509 @item ?
510 matches any single character, and
511 
512 @item *.*
513 matches any string, even if no . is present.
514 @end table
515 
516 Tilde expansion is performed on each of the patterns before looking for
517 matching filenames. For example:
518 
519 @example
520 ls
521  @result{}
522  file1 file2 file3 myfile1 myfile1b
523 glob ("*file1")
524  @result{}
525  @{
526  [1,1] = file1
527  [2,1] = myfile1
528  @}
529 glob ("myfile?")
530  @result{}
531  @{
532  [1,1] = myfile1
533  @}
534 glob ("*.*")
535  @result{}
536  @{
537  [1,1] = file1
538  [2,1] = file2
539  [3,1] = file3
540  [4,1] = myfile1
541  [5,1] = myfile1b
542  @}
543 @end example
544 @seealso{glob, dir}
545 @end deftypefn */)
546 {
547  if (args.length () == 0)
548  return ovl ();
549 
550  string_vector pat = args(0).string_vector_value ();
551 
553 
555 }
556 
557 /*
558 %!test
559 %! tmpdir = tempname;
560 %! filename = {"file1", "file2", "file3", "myfile1", "myfile1b"};
561 %! if (mkdir (tmpdir))
562 %! cwd = pwd;
563 %! cd (tmpdir);
564 %! if (strcmp (canonicalize_file_name (pwd), canonicalize_file_name (tmpdir)))
565 %! a = 0;
566 %! for n = 1:5
567 %! save (filename{n}, "a");
568 %! endfor
569 %! else
570 %! rmdir (tmpdir);
571 %! error ("Couldn't change to temporary dir");
572 %! endif
573 %! else
574 %! error ("Couldn't create temporary directory");
575 %! endif
576 %! result1 = glob ("*file1");
577 %! result2 = glob ("myfile?");
578 %! result3 = glob ("file[12]");
579 %! for n = 1:5
580 %! delete (filename{n});
581 %! endfor
582 %! cd (cwd);
583 %! rmdir (tmpdir);
584 %! assert (result1, {"file1"; "myfile1"});
585 %! assert (result2, {"myfile1"});
586 %! assert (result3, {"file1"; "file2"});
587 */
588 
589 DEFUN (__fnmatch__, args, ,
590  doc: /* -*- texinfo -*-
591 @deftypefn {} {} fnmatch (@var{pattern}, @var{string})
592 Return true or false for each element of @var{string} that matches any of
593 the elements of the string array @var{pattern}, using the rules of
594 filename pattern matching.
595 
596 For example:
597 
598 @example
599 @group
600 fnmatch ("a*b", @{"ab"; "axyzb"; "xyzab"@})
601  @result{} [ 1; 1; 0 ]
602 @end group
603 @end example
604 @seealso{glob, regexp}
605 @end deftypefn */)
606 {
607  if (args.length () != 2)
608  print_usage ();
609 
610  string_vector pat = args(0).string_vector_value ();
611  string_vector str = args(1).string_vector_value ();
612 
614 
615  return ovl (pattern.match (str));
616 }
617 
618 DEFUN (filesep, args, ,
619  doc: /* -*- texinfo -*-
620 @deftypefn {} {} filesep ()
621 @deftypefnx {} {} filesep ("all")
622 Return the system-dependent character used to separate directory names.
623 
624 If @qcode{"all"} is given, the function returns all valid file separators
625 in the form of a string. The list of file separators is system-dependent.
626 It is @samp{/} (forward slash) under UNIX or @w{Mac OS X}, @samp{/} and
627 @samp{\} (forward and backward slashes) under Windows.
628 @seealso{pathsep}
629 @end deftypefn */)
630 {
631  int nargin = args.length ();
632 
633  if (nargin > 1)
634  print_usage ();
635 
637 
638  if (nargin == 0)
640  else
641  {
642  std::string s = args(0).xstring_value ("filesep: argument must be a string");
643  if (s != "all")
644  error ("filesep: argument must be \"all\"");
645 
647  }
648 
649  return retval;
650 }
651 
652 DEFUN (pathsep, args, nargout,
653  doc: /* -*- texinfo -*-
654 @deftypefn {} {@var{val} =} pathsep ()
655 @deftypefnx {} {@var{old_val} =} pathsep (@var{new_val})
656 Query or set the character used to separate directories in a path.
657 @seealso{filesep}
658 @end deftypefn */)
659 {
660  int nargin = args.length ();
661 
662  if (nargin > 1)
663  print_usage ();
664 
666 
667  if (nargout > 0 || nargin == 0)
669 
670  if (nargin == 1)
671  {
672  std::string sval = args(0).xstring_value ("pathsep: argument must be a single character");
673 
674  switch (sval.length ())
675  {
676  case 1:
678  break;
679 
680  case 0:
682  break;
683 
684  default:
685  error ("pathsep: argument must be a single character");
686  break;
687  }
688  }
689 
690  return retval;
691 }
692 
693 DEFUN (confirm_recursive_rmdir, args, nargout,
694  doc: /* -*- texinfo -*-
695 @deftypefn {} {@var{val} =} confirm_recursive_rmdir ()
696 @deftypefnx {} {@var{old_val} =} confirm_recursive_rmdir (@var{new_val})
697 @deftypefnx {} {} confirm_recursive_rmdir (@var{new_val}, "local")
698 Query or set the internal variable that controls whether Octave
699 will ask for confirmation before recursively removing a directory tree.
700 
701 When called from inside a function with the @qcode{"local"} option, the
702 variable is changed locally for the function and any subroutines it calls.
703 The original variable value is restored when exiting the function.
704 @seealso{rmdir}
705 @end deftypefn */)
706 {
707  return SET_INTERNAL_VARIABLE (confirm_recursive_rmdir);
708 }
static std::string dir_sep_str(void)
Definition: file-ops.h:80
static std::string get_current_directory(void)
Definition: oct-env.cc:136
Definition: Cell.h:37
OCTINTERP_API octave_value_list Flink(const octave_value_list &=octave_value_list(), int=0)
static bool chdir(const std::string &newdir)
Definition: oct-env.cc:256
OCTAVE_EXPORT octave_value_list isa nd deftypefn *return ovl(args(0).is_integer_type())
OCTINTERP_API void print_usage(void)
Definition: defun.cc:52
static std::string dir_sep_chars(void)
Definition: file-ops.h:85
int symlink(const std::string &old_name, const std::string &new_name)
Definition: file-ops.cc:470
static int octave_change_to_directory(const std::string &newdir)
Definition: dirfns.cc:71
OCTINTERP_API octave_value_list Frmdir(const octave_value_list &=octave_value_list(), int=0)
OCTINTERP_API octave_value_list Freadlink(const octave_value_list &=octave_value_list(), int=0)
OCTINTERP_API octave_value_list Frename(const octave_value_list &=octave_value_list(), int=0)
#define DEFUN(name, args_name, nargout_name, doc)
Definition: defun.h:46
void error(const char *fmt,...)
Definition: error.cc:570
#define SET_INTERNAL_VARIABLE(NM)
Definition: variables.h:126
OCTINTERP_API octave_value_list Fsymlink(const octave_value_list &=octave_value_list(), int=0)
Definition: dir-ops.h:36
s
Definition: file-io.cc:2682
static bool Vconfirm_recursive_rmdir
Definition: dirfns.cc:65
static std::string tilde_expand(const std::string &)
Definition: file-ops.cc:301
int recursive_rmdir(const std::string &name)
Definition: file-ops.cc:567
int rename(const std::string &from, const std::string &to)
Definition: file-ops.cc:521
string_vector read(void)
Definition: dir-ops.cc:70
JNIEnv void * args
Definition: ov-java.cc:67
#define DEFALIAS(alias, name)
Definition: defun.h:65
bool is_dir(void) const
Definition: file-stat.cc:57
string_vector windows_glob(const string_vector &pat)
Definition: oct-glob.cc:146
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function xample nargout(@histc)
Definition: ov-usr-fcn.cc:935
static std::string get_home_directory(void)
Definition: oct-env.cc:143
int link(const std::string &old_name, const std::string &new_name)
Definition: file-ops.cc:447
int nargin
Definition: graphics.cc:10115
std::string str
Definition: hash.cc:118
static char path_sep_char(void)
Definition: pathsearch.h:99
#define DEFUNX(name, fname, args_name, nargout_name, doc)
Definition: defun.h:54
octave_value retval
Definition: data.cc:6294
string_vector & sort(bool make_uniq=false)
Definition: str-vec.cc:74
may be zero for pure relative error test tem the relative tolerance must be greater than or equal to
Definition: Quad-opts.cc:233
octave::sys::time Vlast_chdir_time
Definition: dirfns.cc:68
With real return the complex result
Definition: data.cc:3375
static std::string concat(const std::string &, const std::string &)
Definition: file-ops.cc:375
static std::string path_sep_str(void)
Definition: pathsearch.h:109
int mkdir(const std::string &nm, mode_t md)
Definition: file-ops.cc:407
bool octave_yes_or_no(const std::string &prompt)
int rmdir(const std::string &name)
Definition: file-ops.cc:543
static void update(void)
Definition: load-path.h:88
is longer than or if then or only for unique occurrences of the complete pattern(false).The default is true.If a cell array of strings ar
Definition: strfind.cc:192
int chdir(const std::string &path_arg)
Definition: lo-sysdep.cc:59
int readlink(const std::string &path, std::string &result)
Definition: file-ops.cc:493
octave::sys::file_stat fs(filename)
std::string error(void) const
Definition: dir-ops.h:77
void stamp(void)
Definition: oct-time.cc:92
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
Definition: utils.cc:854
string_vector glob(const string_vector &pat)
Definition: oct-glob.cc:70
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))