Home > functions > common > utility > vb_mkdir.m

vb_mkdir

PURPOSE ^

compatible mkdir for MATLAB6 or MATLAB7

SYNOPSIS ^

function err_code = vb_mkdir(target_dir)

DESCRIPTION ^

 compatible mkdir for MATLAB6 or MATLAB7
 [usage]
   err_code = vb_mkdir(target_dir)
 [input]
   target_dir : directory name which you want to make
 [output]
     err_code : error code (0 or 1)
              :  =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
0003 % [usage]
0004 %   err_code = vb_mkdir(target_dir)
0005 % [input]
0006 %   target_dir : directory name which you want to make
0007 % [output]
0008 %     err_code : error code (0 or 1)
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 
0021 if vb_matlab_version('<=', '6')
0022   if isequal(target_dir(length(target_dir)),filesep)
0023     target_dir(length(target_dir)) = '';
0024   end
0025   
0026   [vt_path,vt_name] = fileparts(target_dir);
0027   
0028   mkdir(vt_path,vt_name);
0029   
0030 elseif vb_matlab_version('==', '7')
0031   mkdir(target_dir);
0032 else
0033   warning('unexpected MATLAB version : %d\n', vb_matlab_version);
0034   mkdir(target_dir);
0035 end
0036 
0037 %%% END OF FILE %%%

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005