diff 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
line wrap: on
line diff
--- a/libinterp/corefcn/dirfns.cc	Wed Oct 13 17:59:06 2021 +0200
+++ b/libinterp/corefcn/dirfns.cc	Wed Oct 13 10:36:20 2021 -0700
@@ -236,10 +236,10 @@
 If the optional second parameter is supplied with value @qcode{"s"},
 recursively remove all subdirectories as well.
 
-If successful, @var{status} is 1, and @var{msg}, @var{msgid} are empty
-character strings ("").  Otherwise, @var{status} is 0, @var{msg} contains a
-system-dependent error message, and @var{msgid} contains a unique message
-identifier.
+If successful, @var{status} is logical 1, and @var{msg}, @var{msgid} are empty
+character strings ("").  Otherwise, @var{status} is logical 0, @var{msg}
+contains a system-dependent error message, and @var{msgid} contains a unique
+message identifier.
 
 @seealso{mkdir, confirm_recursive_rmdir, pwd}
 @end deftypefn */)
@@ -298,9 +298,9 @@
   else
     {
       if (status < 0)
-        retval = ovl (0.0, msg, "rmdir");
+        retval = ovl (false, msg, "rmdir");
       else
-        retval = ovl (1.0, "", "");
+        retval = ovl (true, "", "");
     }
 
   return retval;