0001 function vb_batch_job_mkdir(dummy, mkdir_parm)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 if ~exist('dummy', 'var')
0019 error('dummy is a required parameter.');
0020 end
0021 if ~exist('mkdir_parm', 'var')
0022 error('mkdir_parm is a required parameter.');
0023 end
0024 if ~isfield(mkdir_parm, 'directories')
0025 error('mkdir_parm should have a field named directories');
0026 end
0027
0028
0029
0030
0031 directories = mkdir_parm.directories;
0032 Ndirectories = length(directories);
0033 const = vb_define_verbose;
0034
0035 for k=1:Ndirectories
0036 directory = directories{k};
0037 if ~isempty(directory)
0038 err_code = 1;
0039 err_msg = '';
0040 try
0041 err_code = vb_mkdir(directory);
0042 catch
0043 err_code = 0;
0044 err = lasterror;
0045 err_msg = err.message;
0046 end
0047
0048 if err_code == 0
0049
0050 vb_disp(...
0051 sprintf('''%s'' was NOT created.', directory), ...
0052 const.VERBOSE_LEVEL_WARNING);
0053 else
0054 vb_disp(...
0055 sprintf('''%s'' was created.', directory), ...
0056 const.VERBOSE_LEVEL_NOTICE);
0057 end
0058 end
0059 end
0060