comparison 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
comparison
equal deleted inserted replaced
30240:a0bcfaf04cc1 30241:ba4aebad10d1
31 ## creating any intermediate directories if necessary. 31 ## creating any intermediate directories if necessary.
32 ## 32 ##
33 ## If @var{dirname} is a relative path, and no @var{parent} directory is 33 ## If @var{dirname} is a relative path, and no @var{parent} directory is
34 ## specified, then the present working directory is used. 34 ## specified, then the present working directory is used.
35 ## 35 ##
36 ## If successful, @var{status} is 1, and @var{msg} and @var{msgid} are empty 36 ## If successful, @var{status} is logical 1, and @var{msg}, @var{msgid} are
37 ## strings (""). Otherwise, @var{status} is 0, @var{msg} contains a 37 ## empty character strings (""). Otherwise, @var{status} is logical 0,
38 ## system-dependent error message, and @var{msgid} contains a unique message 38 ## @var{msg} contains a system-dependent error message, and @var{msgid}
39 ## identifier. 39 ## contains a unique message identifier. Note that the status code is exactly
40 ## opposite that of the @code{system} command.
40 ## 41 ##
41 ## When creating a directory permissions will be set to 42 ## When creating a directory permissions will be set to
42 ## @w{@code{0777 - UMASK}}. 43 ## @w{@code{0777 - UMASK}}.
43 ## 44 ##
44 ## @seealso{rmdir, pwd, cd, umask} 45 ## @seealso{rmdir, pwd, cd, umask}
82 endfunction 83 endfunction
83 84
84 ## Recursively make directories until parent/dirname can be created. 85 ## Recursively make directories until parent/dirname can be created.
85 function [status, msg, msgid] = mkdir_recur (parent, dirname) 86 function [status, msg, msgid] = mkdir_recur (parent, dirname)
86 87
87 status = 1; 88 status = true;
88 89
89 if (isempty (parent)) 90 if (isempty (parent))
90 error ("mkdir: invalid PARENT"); 91 error ("mkdir: invalid PARENT");
91 endif 92 endif
92 93