Mercurial > octave
diff scripts/miscellaneous/mkdir.m @ 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 | 120e878f343f |
children | 796f54d4ddbf |
line wrap: on
line diff
--- a/scripts/miscellaneous/mkdir.m Wed Oct 13 17:59:06 2021 +0200 +++ b/scripts/miscellaneous/mkdir.m Wed Oct 13 10:36:20 2021 -0700 @@ -33,10 +33,11 @@ ## If @var{dirname} is a relative path, and no @var{parent} directory is ## specified, then the present working directory is used. ## -## If successful, @var{status} is 1, and @var{msg} and @var{msgid} are empty -## 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. Note that the status code is exactly +## opposite that of the @code{system} command. ## ## When creating a directory permissions will be set to ## @w{@code{0777 - UMASK}}. @@ -84,7 +85,7 @@ ## Recursively make directories until parent/dirname can be created. function [status, msg, msgid] = mkdir_recur (parent, dirname) - status = 1; + status = true; if (isempty (parent)) error ("mkdir: invalid PARENT");