Code covered by the BSD License  

Highlights from
Statistical Learning Toolbox

from Statistical Learning Toolbox by Dahua Lin
Functions for statistical learning, pattern recognition and computer vision, covering many topics.

Description of slrmdir
Home > sltoolbox > fileio > slrmdir.m

slrmdir

PURPOSE ^

SLMKDIR Makes a directory if it does not exist

SYNOPSIS ^

function slrmdir(dirname, parentpath)

DESCRIPTION ^

SLMKDIR Makes a directory if it does not exist

 $ Syntax $
   - slrmdir(dirname)
   - slrmdir(dirname, parentpath)

 $ Arguments $
   - dirname:      the name (relative path) of the diretory (r.t parent)
   - parentpath:   the path of the parent directory
   - dirpath:      the path of the created directory (r.t. '')

 $ Description $
   - dirpath = slmkdir(dirname) deletes a diretory of given name if it
     exists.

   - dirpath = slmkdir(dirname, parentpath) deletes a diectory of given 
     name if it exists, relative to parent path.

 $ Remarks $
   - This function recursively deletes all sub-folders.

 $ History $
   - Created by Dahua Lin, on Aug 12nd, 2006

CROSS-REFERENCE INFORMATION ^

This function calls:
  • sladdpath SLADDPATH Adds dirpath to precede the filenames
This function is called by:

SOURCE CODE ^

0001 function slrmdir(dirname, parentpath)
0002 %SLMKDIR Makes a directory if it does not exist
0003 %
0004 % $ Syntax $
0005 %   - slrmdir(dirname)
0006 %   - slrmdir(dirname, parentpath)
0007 %
0008 % $ Arguments $
0009 %   - dirname:      the name (relative path) of the diretory (r.t parent)
0010 %   - parentpath:   the path of the parent directory
0011 %   - dirpath:      the path of the created directory (r.t. '')
0012 %
0013 % $ Description $
0014 %   - dirpath = slmkdir(dirname) deletes a diretory of given name if it
0015 %     exists.
0016 %
0017 %   - dirpath = slmkdir(dirname, parentpath) deletes a diectory of given
0018 %     name if it exists, relative to parent path.
0019 %
0020 % $ Remarks $
0021 %   - This function recursively deletes all sub-folders.
0022 %
0023 % $ History $
0024 %   - Created by Dahua Lin, on Aug 12nd, 2006
0025 %
0026 
0027 if isempty(dirname)
0028     return;
0029 end
0030 
0031 if nargin < 2 
0032     parentpath = '';
0033 end
0034 
0035 dirpath = sladdpath(dirname, parentpath);
0036 
0037 if exist(dirpath, 'dir')
0038     rmdir(dirpath, 's');
0039 end
0040     
0041 
0042 
0043

Generated on Wed 20-Sep-2006 12:43:11 by m2html © 2003

Contact us at files@mathworks.com