523
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
523
|
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 2, or (at your option) any |
|
10 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, write to the Free |
5307
|
19 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
20 02110-1301, USA. |
523
|
21 |
|
22 */ |
|
23 |
|
24 #ifdef HAVE_CONFIG_H |
1192
|
25 #include <config.h> |
523
|
26 #endif |
|
27 |
1341
|
28 #include <cerrno> |
|
29 #include <cstdio> |
|
30 #include <cstddef> |
|
31 #include <cstdlib> |
|
32 #include <cstring> |
|
33 |
5765
|
34 #include <sstream> |
1728
|
35 #include <string> |
|
36 |
1832
|
37 #ifdef HAVE_UNISTD_H |
2442
|
38 #ifdef HAVE_SYS_TYPES_H |
1832
|
39 #include <sys/types.h> |
2442
|
40 #endif |
1832
|
41 #include <unistd.h> |
|
42 #endif |
|
43 |
2926
|
44 #include "file-ops.h" |
|
45 #include "file-stat.h" |
|
46 #include "glob-match.h" |
|
47 #include "oct-env.h" |
5777
|
48 #include "pathsearch.h" |
1755
|
49 #include "str-vec.h" |
|
50 |
5102
|
51 #include "Cell.h" |
1355
|
52 #include "defun.h" |
1781
|
53 #include "dir-ops.h" |
1355
|
54 #include "dirfns.h" |
|
55 #include "error.h" |
1402
|
56 #include "gripes.h" |
5640
|
57 #include "input.h" |
5832
|
58 #include "load-path.h" |
1750
|
59 #include "oct-obj.h" |
1355
|
60 #include "pager.h" |
|
61 #include "procstream.h" |
|
62 #include "sysdep.h" |
1750
|
63 #include "toplev.h" |
1449
|
64 #include "unwind-prot.h" |
523
|
65 #include "utils.h" |
1742
|
66 #include "variables.h" |
523
|
67 |
5640
|
68 // TRUE means we ask for confirmation before recursively removing a |
|
69 // directory tree. |
|
70 static bool Vconfirm_recursive_rmdir = true; |
|
71 |
1328
|
72 static int |
3523
|
73 octave_change_to_directory (const std::string& newdir) |
1328
|
74 { |
5979
|
75 int cd_ok = octave_env::chdir (file_ops::tilde_expand (newdir)); |
1328
|
76 |
|
77 if (cd_ok) |
5832
|
78 { |
|
79 // FIXME -- should this be handled as a list of functions |
|
80 // to call so users can add their own chdir handlers? |
|
81 |
|
82 load_path::update (); |
|
83 } |
1328
|
84 else |
3531
|
85 { |
|
86 using namespace std; |
|
87 |
|
88 error ("%s: %s", newdir.c_str (), strerror (errno)); |
|
89 } |
1328
|
90 |
|
91 return cd_ok; |
|
92 } |
|
93 |
4208
|
94 DEFCMD (cd, args, , |
3301
|
95 "-*- texinfo -*-\n\ |
|
96 @deffn {Command} cd dir\n\ |
|
97 @deffnx {Command} chdir dir\n\ |
|
98 Change the current working directory to @var{dir}. If @var{dir} is\n\ |
|
99 omitted, the current directory is changed to the users home\n\ |
|
100 directory. For example,\n\ |
523
|
101 \n\ |
3301
|
102 @example\n\ |
|
103 cd ~/octave\n\ |
|
104 @end example\n\ |
|
105 \n\ |
|
106 @noindent\n\ |
|
107 Changes the current working directory to @file{~/octave}. If the\n\ |
|
108 directory does not exist, an error message is printed and the working\n\ |
|
109 directory is not changed.\n\ |
5597
|
110 @seealso{mkdir, rmdir, dir}\n\ |
3301
|
111 @end deffn") |
523
|
112 { |
2086
|
113 octave_value_list retval; |
523
|
114 |
1755
|
115 int argc = args.length () + 1; |
|
116 |
1965
|
117 string_vector argv = args.make_argv ("cd"); |
1755
|
118 |
|
119 if (error_state) |
|
120 return retval; |
523
|
121 |
|
122 if (argc > 1) |
|
123 { |
5872
|
124 std::string dirname = argv[1]; |
523
|
125 |
1750
|
126 if (dirname.length () > 0 |
1755
|
127 && ! octave_change_to_directory (dirname)) |
523
|
128 { |
|
129 return retval; |
|
130 } |
|
131 } |
|
132 else |
|
133 { |
3523
|
134 std::string home_dir = octave_env::get_home_directory (); |
2926
|
135 |
|
136 if (home_dir.empty () || ! octave_change_to_directory (home_dir)) |
|
137 return retval; |
523
|
138 } |
|
139 |
|
140 return retval; |
|
141 } |
|
142 |
611
|
143 DEFALIAS (chdir, cd); |
|
144 |
1957
|
145 DEFUN (pwd, , nargout, |
3301
|
146 "-*- texinfo -*-\n\ |
|
147 @deftypefn {Built-in Function} {} pwd ()\n\ |
|
148 Return the current working directory.\n\ |
5597
|
149 @seealso{dir, ls}\n\ |
3301
|
150 @end deftypefn") |
523
|
151 { |
5979
|
152 return octave_value (octave_env::getcwd ()); |
523
|
153 } |
|
154 |
1957
|
155 DEFUN (readdir, args, , |
3301
|
156 "-*- texinfo -*-\n\ |
|
157 @deftypefn {Built-in Function} {[@var{files}, @var{err}, @var{msg}] =} readdir (@var{dir})\n\ |
4691
|
158 Return names of the files in the directory @var{dir} as a cell array of\n\ |
|
159 strings. If an error occurs, return an empty cell array in @var{files}.\n\ |
1389
|
160 \n\ |
3301
|
161 If successful, @var{err} is 0 and @var{msg} is an empty string.\n\ |
|
162 Otherwise, @var{err} is nonzero and @var{msg} contains a\n\ |
|
163 system-dependent error message.\n\ |
5597
|
164 @seealso{dir, glob}\n\ |
3301
|
165 @end deftypefn") |
1389
|
166 { |
2086
|
167 octave_value_list retval; |
1389
|
168 |
3523
|
169 retval(2) = std::string (); |
2669
|
170 retval(1) = -1.0; |
4691
|
171 retval(0) = Cell (); |
2669
|
172 |
1401
|
173 if (args.length () == 1) |
1389
|
174 { |
3523
|
175 std::string dirname = args(0).string_value (); |
1389
|
176 |
1401
|
177 if (error_state) |
1781
|
178 gripe_wrong_type_arg ("readdir", args(0)); |
1401
|
179 else |
|
180 { |
5872
|
181 dir_entry dir (dirname); |
1389
|
182 |
1401
|
183 if (dir) |
1389
|
184 { |
1781
|
185 string_vector dirlist = dir.read (); |
4691
|
186 retval(0) = Cell (dirlist.qsort ()); |
2669
|
187 retval(1) = 0.0; |
1401
|
188 } |
|
189 else |
|
190 { |
2669
|
191 retval(2) = dir.error (); |
1401
|
192 } |
1389
|
193 } |
|
194 } |
|
195 else |
5823
|
196 print_usage (); |
1389
|
197 |
1401
|
198 return retval; |
|
199 } |
|
200 |
5775
|
201 // FIXME -- should maybe also allow second arg to specify |
5476
|
202 // mode? OTOH, that might cause trouble with compatibility later... |
1401
|
203 |
5637
|
204 DEFCMD (mkdir, args, , |
3301
|
205 "-*- texinfo -*-\n\ |
5476
|
206 @deftypefn {Built-in Function} {[@var{status}, @var{msg}, @var{msgid}] =} mkdir (@var{dir})\n\ |
3301
|
207 Create a directory named @var{dir}.\n\ |
1401
|
208 \n\ |
5476
|
209 If successful, @var{status} is 1, with @var{msg} and @var{msgid} empty\n\ |
|
210 character strings. Otherwise, @var{status} is 0, @var{msg} contains a\n\ |
|
211 system-dependent error message, and @var{msgid} contains a unique\n\ |
|
212 message identifier.\n\ |
5597
|
213 @seealso{rmdir}\n\ |
3301
|
214 @end deftypefn") |
1401
|
215 { |
2086
|
216 octave_value_list retval; |
1401
|
217 |
5476
|
218 retval(2) = std::string (); |
3523
|
219 retval(1) = std::string (); |
5476
|
220 retval(0) = false; |
1401
|
221 |
|
222 if (args.length () == 1) |
|
223 { |
3523
|
224 std::string dirname = args(0).string_value (); |
1401
|
225 |
|
226 if (error_state) |
1402
|
227 gripe_wrong_type_arg ("mkdir", args(0)); |
1489
|
228 else |
1401
|
229 { |
3523
|
230 std::string msg; |
2669
|
231 |
2926
|
232 int status = file_ops::mkdir (file_ops::tilde_expand (dirname), |
|
233 0777, msg); |
1489
|
234 |
2669
|
235 if (status < 0) |
5476
|
236 { |
|
237 retval(2) = "mkdir"; |
|
238 retval(1) = msg; |
|
239 } |
|
240 else |
|
241 retval(0) = true; |
1401
|
242 } |
|
243 } |
|
244 else |
5823
|
245 print_usage (); |
1401
|
246 |
|
247 return retval; |
|
248 } |
|
249 |
5637
|
250 DEFCMD (rmdir, args, , |
3301
|
251 "-*- texinfo -*-\n\ |
5476
|
252 @deftypefn {Built-in Function} {[@var{status}, @var{msg}, @var{msgid}] =} rmdir (@var{dir})\n\ |
|
253 @deftypefnx {Built-in Function} {[@var{status}, @var{msg}, @var{msgid}] =} rmdir (@var{dir}, @code{\"s\"})\n\ |
3301
|
254 Remove the directory named @var{dir}.\n\ |
1401
|
255 \n\ |
5476
|
256 If successful, @var{status} is 1, with @var{msg} and @var{msgid} empty\n\ |
|
257 character strings. Otherwise, @var{status} is 0, @var{msg} contains a\n\ |
|
258 system-dependent error message, and @var{msgid} contains a unique\n\ |
|
259 message identifier.\n\ |
|
260 \n\ |
6134
|
261 If the optional second parameter is suplied with value @code{\"s\"},\n\ |
|
262 recursively remove all subdirectories as well.\n\ |
5640
|
263 @seealso{mkdir, confirm_recursive_rmdir}\n\ |
3301
|
264 @end deftypefn") |
1401
|
265 { |
2086
|
266 octave_value_list retval; |
1401
|
267 |
5476
|
268 retval(2) = std::string (); |
3523
|
269 retval(1) = std::string (); |
5476
|
270 retval(0) = false; |
1401
|
271 |
5476
|
272 int nargin = args.length (); |
|
273 |
|
274 if (nargin == 1 || nargin == 2) |
1401
|
275 { |
3523
|
276 std::string dirname = args(0).string_value (); |
1401
|
277 |
|
278 if (error_state) |
1402
|
279 gripe_wrong_type_arg ("rmdir", args(0)); |
1489
|
280 else |
1401
|
281 { |
5640
|
282 std::string fulldir = file_ops::tilde_expand (dirname); |
|
283 int status = -1; |
3523
|
284 std::string msg; |
2669
|
285 |
5639
|
286 if (nargin == 2) |
|
287 { |
|
288 if (args(1).string_value () == "s") |
5640
|
289 { |
|
290 bool doit = true; |
|
291 |
|
292 if (interactive && Vconfirm_recursive_rmdir) |
|
293 { |
|
294 std::string prompt |
|
295 = "remove entire contents of " + fulldir + "? "; |
|
296 |
|
297 doit = octave_yes_or_no (prompt); |
|
298 } |
|
299 |
|
300 if (doit) |
|
301 status = file_ops::recursive_rmdir (fulldir, msg); |
|
302 } |
5639
|
303 else |
|
304 error ("rmdir: expecting second argument to be \"s\""); |
|
305 } |
|
306 else |
5640
|
307 status = file_ops::rmdir (fulldir, msg); |
2669
|
308 |
|
309 if (status < 0) |
5476
|
310 { |
|
311 retval(2) = "rmdir"; |
|
312 retval(1) = msg; |
|
313 } |
|
314 else |
|
315 retval(0) = true; |
1401
|
316 } |
|
317 } |
1389
|
318 else |
5823
|
319 print_usage (); |
1401
|
320 |
|
321 return retval; |
|
322 } |
|
323 |
3710
|
324 DEFUN (link, args, , |
|
325 "-*- texinfo -*-\n\ |
|
326 @deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} link (@var{old}, @var{new})\n\ |
|
327 Create a new link (also known as a hard link) to an existing file.\n\ |
|
328 \n\ |
|
329 If successful, @var{err} is 0 and @var{msg} is an empty string.\n\ |
|
330 Otherwise, @var{err} is nonzero and @var{msg} contains a\n\ |
|
331 system-dependent error message.\n\ |
5597
|
332 @seealso{symlink}\n\ |
3710
|
333 @end deftypefn") |
|
334 { |
|
335 octave_value_list retval; |
|
336 |
|
337 retval(1) = std::string (); |
|
338 retval(0) = -1.0; |
|
339 |
|
340 if (args.length () == 2) |
|
341 { |
|
342 std::string from = args(0).string_value (); |
|
343 |
|
344 if (error_state) |
|
345 gripe_wrong_type_arg ("link", args(0)); |
|
346 else |
|
347 { |
|
348 std::string to = args(1).string_value (); |
|
349 |
|
350 if (error_state) |
|
351 gripe_wrong_type_arg ("link", args(1)); |
|
352 else |
|
353 { |
|
354 std::string msg; |
|
355 |
|
356 int status = file_ops::link (from, to, msg); |
|
357 |
4233
|
358 retval(0) = status; |
3710
|
359 |
|
360 if (status < 0) |
|
361 retval(1) = msg; |
|
362 } |
|
363 } |
|
364 } |
|
365 else |
5823
|
366 print_usage (); |
3710
|
367 |
|
368 return retval; |
|
369 } |
|
370 |
|
371 DEFUN (symlink, args, , |
|
372 "-*- texinfo -*-\n\ |
|
373 @deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} symlink (@var{old}, @var{new})\n\ |
|
374 Create a symbolic link @var{new} which contains the string @var{old}.\n\ |
|
375 \n\ |
|
376 If successful, @var{err} is 0 and @var{msg} is an empty string.\n\ |
|
377 Otherwise, @var{err} is nonzero and @var{msg} contains a\n\ |
|
378 system-dependent error message.\n\ |
5597
|
379 @seealso{link, readlink}\n\ |
3710
|
380 @end deftypefn") |
|
381 { |
|
382 octave_value_list retval; |
|
383 |
|
384 retval(1) = std::string (); |
|
385 retval(0) = -1.0; |
|
386 |
|
387 if (args.length () == 2) |
|
388 { |
|
389 std::string from = args(0).string_value (); |
|
390 |
|
391 if (error_state) |
|
392 gripe_wrong_type_arg ("symlink", args(0)); |
|
393 else |
|
394 { |
|
395 std::string to = args(1).string_value (); |
|
396 |
|
397 if (error_state) |
|
398 gripe_wrong_type_arg ("symlink", args(1)); |
|
399 else |
|
400 { |
|
401 std::string msg; |
|
402 |
|
403 int status = file_ops::symlink (from, to, msg); |
|
404 |
4233
|
405 retval(0) = status; |
3710
|
406 |
|
407 if (status < 0) |
|
408 retval(1) = msg; |
|
409 } |
|
410 } |
|
411 } |
|
412 else |
5823
|
413 print_usage (); |
3710
|
414 |
|
415 return retval; |
|
416 } |
|
417 |
|
418 DEFUN (readlink, args, , |
|
419 "-*- texinfo -*-\n\ |
4169
|
420 @deftypefn {Built-in Function} {[@var{result}, @var{err}, @var{msg}] =} readlink (@var{symlink})\n\ |
3710
|
421 Read the value of the symbolic link @var{symlink}.\n\ |
|
422 \n\ |
|
423 If successful, @var{result} contains the contents of the symbolic link\n\ |
|
424 @var{symlink}, @var{err} is 0 and @var{msg} is an empty string.\n\ |
|
425 Otherwise, @var{err} is nonzero and @var{msg} contains a\n\ |
|
426 system-dependent error message.\n\ |
5597
|
427 @seealso{link, symlink}\n\ |
3710
|
428 @end deftypefn") |
|
429 { |
|
430 octave_value_list retval; |
|
431 |
|
432 retval(2) = std::string (); |
|
433 retval(1) = -1.0; |
|
434 retval(0) = std::string (); |
|
435 |
|
436 if (args.length () == 1) |
|
437 { |
|
438 std::string symlink = args(0).string_value (); |
|
439 |
|
440 if (error_state) |
|
441 gripe_wrong_type_arg ("readlink", args(0)); |
|
442 else |
|
443 { |
|
444 std::string result; |
|
445 std::string msg; |
|
446 |
|
447 int status = file_ops::readlink (symlink, result, msg); |
|
448 |
|
449 retval(0) = result; |
|
450 |
4233
|
451 retval(1) = status; |
3710
|
452 |
|
453 if (status < 0) |
|
454 retval(2) = msg; |
|
455 } |
|
456 } |
|
457 else |
5823
|
458 print_usage (); |
3710
|
459 |
|
460 return retval; |
|
461 } |
|
462 |
1957
|
463 DEFUN (rename, args, , |
3301
|
464 "-*- texinfo -*-\n\ |
|
465 @deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} rename (@var{old}, @var{new})\n\ |
|
466 Change the name of file @var{old} to @var{new}.\n\ |
1401
|
467 \n\ |
3301
|
468 If successful, @var{err} is 0 and @var{msg} is an empty string.\n\ |
|
469 Otherwise, @var{err} is nonzero and @var{msg} contains a\n\ |
|
470 system-dependent error message.\n\ |
5597
|
471 @seealso{ls, dir}\n\ |
3301
|
472 @end deftypefn") |
1401
|
473 { |
2086
|
474 octave_value_list retval; |
1401
|
475 |
3523
|
476 retval(1) = std::string (); |
2669
|
477 retval(0) = -1.0; |
1401
|
478 |
|
479 if (args.length () == 2) |
|
480 { |
3523
|
481 std::string from = args(0).string_value (); |
1728
|
482 |
1401
|
483 if (error_state) |
1402
|
484 gripe_wrong_type_arg ("rename", args(0)); |
|
485 else |
1401
|
486 { |
3523
|
487 std::string to = args(1).string_value (); |
1728
|
488 |
1402
|
489 if (error_state) |
|
490 gripe_wrong_type_arg ("rename", args(1)); |
2669
|
491 else |
1402
|
492 { |
3523
|
493 std::string msg; |
2669
|
494 |
2926
|
495 int status = file_ops::rename (from, to, msg); |
2669
|
496 |
4233
|
497 retval(0) = status; |
2669
|
498 |
|
499 if (status < 0) |
|
500 retval(1) = msg; |
1402
|
501 } |
1401
|
502 } |
|
503 } |
|
504 else |
5823
|
505 print_usage (); |
1401
|
506 |
1389
|
507 return retval; |
|
508 } |
|
509 |
2495
|
510 DEFUN (glob, args, , |
3301
|
511 "-*- texinfo -*-\n\ |
|
512 @deftypefn {Built-in Function} {} glob (@var{pattern})\n\ |
5444
|
513 Given an array of strings (as a char array or a cell array) in\n\ |
|
514 @var{pattern}, return a cell array of file names that match any of\n\ |
|
515 them, or an empty cell array if no patterns match. Tilde expansion\n\ |
|
516 is performed on each of the patterns before looking for matching file\n\ |
|
517 names. For example,\n\ |
2495
|
518 \n\ |
3301
|
519 @example\n\ |
|
520 @group\n\ |
|
521 glob (\"/vm*\")\n\ |
|
522 @result{} \"/vmlinuz\"\n\ |
|
523 @end group\n\ |
|
524 @end example\n\ |
5597
|
525 @seealso{dir, ls, stat, readdir}\n\ |
|
526 @end deftypefn") |
2495
|
527 { |
|
528 octave_value retval; |
|
529 |
|
530 if (args.length () == 1) |
|
531 { |
|
532 string_vector pat = args(0).all_strings (); |
|
533 |
|
534 if (error_state) |
|
535 gripe_wrong_type_arg ("glob", args(0)); |
|
536 else |
|
537 { |
2926
|
538 glob_match pattern (file_ops::tilde_expand (pat)); |
2495
|
539 |
4691
|
540 retval = Cell (pattern.glob ()); |
2495
|
541 } |
|
542 } |
|
543 else |
5823
|
544 print_usage (); |
2495
|
545 |
|
546 return retval; |
|
547 } |
|
548 |
2496
|
549 DEFUN (fnmatch, args, , |
3301
|
550 "-*- texinfo -*-\n\ |
|
551 @deftypefn {Built-in Function} {} fnmatch (@var{pattern}, @var{string})\n\ |
|
552 Return 1 or zero for each element of @var{string} that matches any of\n\ |
|
553 the elements of the string array @var{pattern}, using the rules of\n\ |
|
554 filename pattern matching. For example,\n\ |
2496
|
555 \n\ |
3301
|
556 @example\n\ |
|
557 @group\n\ |
|
558 fnmatch (\"a*b\", [\"ab\"; \"axyzb\"; \"xyzab\"])\n\ |
|
559 @result{} [ 1; 1; 0 ]\n\ |
|
560 @end group\n\ |
|
561 @end example\n\ |
|
562 @end deftypefn") |
2496
|
563 { |
|
564 octave_value retval; |
|
565 |
|
566 if (args.length () == 2) |
|
567 { |
|
568 string_vector pat = args(0).all_strings (); |
|
569 string_vector str = args(1).all_strings (); |
|
570 |
|
571 if (error_state) |
|
572 gripe_wrong_type_arg ("fnmatch", args(0)); |
|
573 else |
|
574 { |
2926
|
575 glob_match pattern (file_ops::tilde_expand (pat)); |
2496
|
576 |
|
577 Array<bool> tmp = pattern.match (str); |
|
578 |
5275
|
579 octave_idx_type n = tmp.length (); |
2496
|
580 |
|
581 ColumnVector result (n); |
|
582 |
5275
|
583 for (octave_idx_type i = 0; i < n; i++) |
2496
|
584 result(i) = tmp(i); |
|
585 |
3418
|
586 retval = result; |
2496
|
587 } |
|
588 } |
|
589 else |
5823
|
590 print_usage (); |
2496
|
591 |
|
592 return retval; |
|
593 } |
|
594 |
5777
|
595 DEFUN (filesep, args, , |
5832
|
596 "-*- texinfo -*-\n\ |
|
597 @deftypefn {Built-in Function} {} filesep ()\n\ |
5777
|
598 Return the system-dependent character used to separate directory names.\n\ |
|
599 @seealso{pathsep, dir, ls}\n\ |
|
600 @end deftypefn") |
|
601 { |
|
602 octave_value retval; |
|
603 |
|
604 if (args.length () == 0) |
|
605 retval = file_ops::dir_sep_str; |
|
606 else |
5823
|
607 print_usage (); |
5777
|
608 |
|
609 return retval; |
|
610 } |
|
611 |
|
612 DEFUN (pathsep, args, , |
|
613 "-*- texinfo -*-\n\ |
|
614 @deftypefn {Built-in Function} {} pathsep ()\n\ |
|
615 Return the system-dependent character used to separate directories in\n\ |
|
616 a path.\n\ |
|
617 @seealso{filesep, dir, ls}\n\ |
|
618 @end deftypefn") |
|
619 { |
|
620 octave_value retval; |
|
621 |
|
622 if (args.length () == 0) |
|
623 retval = dir_path::path_sep_str; |
|
624 else |
5823
|
625 print_usage (); |
5777
|
626 |
|
627 return retval; |
|
628 } |
|
629 |
5794
|
630 DEFUN (confirm_recursive_rmdir, args, nargout, |
|
631 "-*- texinfo -*-\n\ |
|
632 @deftypefn {Built-in Function} {@var{val} =} confirm_recursive_rmdir ()\n\ |
|
633 @deftypefnx {Built-in Function} {@var{old_val} =} confirm_recursive_rmdir (@var{new_val})\n\ |
|
634 Query or set the internal variable that controls whether Octave\n\ |
|
635 will ask for confirmation before recursively removing a directory tree.\n\ |
|
636 @end deftypefn") |
5640
|
637 { |
5794
|
638 return SET_INTERNAL_VARIABLE (confirm_recursive_rmdir); |
4264
|
639 } |
|
640 |
523
|
641 /* |
|
642 ;;; Local Variables: *** |
|
643 ;;; mode: C++ *** |
|
644 ;;; End: *** |
|
645 */ |