1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) 2007 - INRIA - Allan CORNET
4 // This file must be used under the terms of the CeCILL.
5 // This source file is licensed as described in the file COPYING, which
6 // you should have received as part of this distribution. The terms
7 // are also available at
8 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
10 // rmdir remove a directory
11 function [status,msg]=rmdir(varargin)
22 error(msprintf(gettext("%s: Wrong number of input argument(s).\n"),'rmdir'));
25 DirName = varargin(1);
28 DirName = varargin(1) ;
29 SubDir = convstr(varargin(2),'u');
30 if (SubDir == 'S') then
33 error(msprintf(gettext("%s: Wrong value for input argument #%d: Must be ''%s''.\n"),'rmdir',2,'s'));
37 error(msprintf(gettext("%s: Wrong number of input argument(s).\n"),'rmdir'));
41 if findfiles(DirName)<>[] then
43 msg = 'Error : The directory is not empty.'
45 [status,msg] = hidden_rmdir(DirName);
48 [status,msg] = hidden_rmdir(DirName);
51 //------------------------------------------------------------------------
52 function [status,msg]=hidden_rmdir(DirName)
56 if isdir(DirName) then
57 bOK = removedir(DirName);
62 msg = msprintf(gettext("%s: An error occurred: %s\n"),'rmdir', gettext('Undefined'));
66 msg = msprintf(gettext("%s: An error occurred: %s\n"),'rmdir', gettext('The system cannot find the file specified.'));
71 //------------------------------------------------------------------------