function [varargout] = rmdir(varargin)
%RMDIR Remove directory.
%   [SUCCESS,MESSAGE,MESSAGEID] = RMDIR(DIRECTORY,MODE) removes DIRECTORY from
%   the parent directory, subject to access rights. RMDIR can remove
%   subdirectories recursively.
%
%   [SUCCESS,MESSAGE,MESSAGEID] = RMDIR(DIRECTORY) removes DIRECTORY from the
%   parent directory, only if DIRECTORY is an empty directory.
%
%   [SUCCESS,MESSAGE,MESSAGEID] = RMDIR(DIRECTORY, 's') removes DIRECTORY,
%   including the subdirectory tree, from the parent directory. See NOTE 1.
%
%   INPUT PARAMETERS:
%       DIRECTORY: string specifying a directory, relative or absolute.
%                  See NOTE 2.
%       MODE:      character scalar indicating the mode of operation.
%                  's': indicates that the subdirectory tree, implied by DIRECTORY,
%                  will be removed recursively.
%
%   RETURN PARAMETERS:
%       SUCCESS:   logical scalar, defining the outcome of RMDIR.
%                  1 : RMDIR executed successfully.
%                  0 : an error occurred.
%       MESSAGE:   string, defining the error or warning message.
%                  empty string : RMDIR executed successfully.
%                  message : an error or warning message, as applicable.
%       MESSAGEID: string, defining the error or warning identifier.
%                  empty string : RMDIR executed successfully.
%                  message id: the MATLAB error or warning message identifier
%                  (see ERROR, LASTERR, WARNING, LASTWARN).
%
%   NOTE 1: The subdirectory tree will be removed, regardless of the write
%           attribute of any contained file or subdirectory.
%   NOTE 2: UNC paths are supported. RMDIR does not support the wildcard *.
%
%   See also CD, COPYFILE, DELETE, DIR, FILEATTRIB, MKDIR, MOVEFILE.

%   Copyright 1984-2004 The MathWorks, Inc.
%   $Revision: 1.8.4.10 $ $Date: 2004/12/27 23:32:34 $

%   Package: libmwbuiltins
%   Built-in function.

if nargout == 0
  builtin('rmdir', varargin{:});
else
  [varargout{1:nargout}] = builtin('rmdir', varargin{:});
end
