Mercurial > octave
comparison libinterp/corefcn/dirfns.cc @ 30241:ba4aebad10d1
Return logical status variable from file functions for Matlab compatibility.
* NEWS: Announce change.
* dirfns.cc (Frmdir): Update documentation. Change return status to true/false
rather than 1.0/0.0.
* copyfile.m: Update documentation. Change internal variable "sts" to logical
variable. Change any assignments to status to true/false.
* movefile.m: Update documentation. Change internal variable "sts" to logical
variable. Change any assignments to status to true/false.
* mkdir.m: Update documentation.
* mkdir.m (mkdir_recur): Change internal variable "status" to logical.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 13 Oct 2021 10:36:20 -0700 |
parents | 428cccc75cc9 |
children | 796f54d4ddbf |
comparison
equal
deleted
inserted
replaced
30240:a0bcfaf04cc1 | 30241:ba4aebad10d1 |
---|---|
234 Remove the directory named @var{dir}. | 234 Remove the directory named @var{dir}. |
235 | 235 |
236 If the optional second parameter is supplied with value @qcode{"s"}, | 236 If the optional second parameter is supplied with value @qcode{"s"}, |
237 recursively remove all subdirectories as well. | 237 recursively remove all subdirectories as well. |
238 | 238 |
239 If successful, @var{status} is 1, and @var{msg}, @var{msgid} are empty | 239 If successful, @var{status} is logical 1, and @var{msg}, @var{msgid} are empty |
240 character strings (""). Otherwise, @var{status} is 0, @var{msg} contains a | 240 character strings (""). Otherwise, @var{status} is logical 0, @var{msg} |
241 system-dependent error message, and @var{msgid} contains a unique message | 241 contains a system-dependent error message, and @var{msgid} contains a unique |
242 identifier. | 242 message identifier. |
243 | 243 |
244 @seealso{mkdir, confirm_recursive_rmdir, pwd} | 244 @seealso{mkdir, confirm_recursive_rmdir, pwd} |
245 @end deftypefn */) | 245 @end deftypefn */) |
246 { | 246 { |
247 int nargin = args.length (); | 247 int nargin = args.length (); |
296 error ("rmdir: operation failed: %s", msg.c_str ()); | 296 error ("rmdir: operation failed: %s", msg.c_str ()); |
297 } | 297 } |
298 else | 298 else |
299 { | 299 { |
300 if (status < 0) | 300 if (status < 0) |
301 retval = ovl (0.0, msg, "rmdir"); | 301 retval = ovl (false, msg, "rmdir"); |
302 else | 302 else |
303 retval = ovl (1.0, "", ""); | 303 retval = ovl (true, "", ""); |
304 } | 304 } |
305 | 305 |
306 return retval; | 306 return retval; |
307 } | 307 } |
308 | 308 |