Home > vbmeg > functions > common > utility > vb_mkdir.m

vb_mkdir

PURPOSE ^

compatible mkdir for MATLAB6 or MATLAB7,8

SYNOPSIS ^

function err_code = vb_mkdir(target_dir)

DESCRIPTION ^

 compatible mkdir for MATLAB6 or MATLAB7,8
 [usage]
   err_code = vb_mkdir(target_dir)
 [input]
   target_dir : directory name which you want to make
 [output]
  return_code : return code
              :  =0 : failure
              :  =1 : success
 [note]
 
 [history]
   2006-10-06 (Sako) initial version

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function err_code = vb_mkdir(target_dir)
0002 % compatible mkdir for MATLAB6 or MATLAB7,8
0003 % [usage]
0004 %   err_code = vb_mkdir(target_dir)
0005 % [input]
0006 %   target_dir : directory name which you want to make
0007 % [output]
0008 %  return_code : return code
0009 %              :  =0 : failure
0010 %              :  =1 : success
0011 % [note]
0012 %
0013 % [history]
0014 %   2006-10-06 (Sako) initial version
0015 %
0016 % Copyright (C) 2011, ATR All Rights Reserved.
0017 % License : New BSD License(see VBMEG_LICENSE.txt)
0018 
0019 err_code = 1;
0020 if exist(target_dir, 'dir')
0021    return;
0022 end
0023 
0024 if vb_matlab_version('<=', '6')
0025   if isequal(target_dir(length(target_dir)),filesep)
0026     target_dir(length(target_dir)) = '';
0027   end
0028   
0029   [vt_path,vt_name] = fileparts(target_dir);
0030   
0031   mkdir(vt_path,vt_name);
0032   
0033 else
0034   mkdir(target_dir);
0035 end
0036 
0037 %%% END OF FILE %%%

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005