rmdir
Remove folder
Syntax
Description
rmdir
removes
the folder folderName
folderName
from the current folder. folderName
must
be empty. If the operation is not successful, MATLAB® throws an
error to the Command Window.
rmdir
also attempts to remove all
subfolders and files in folderName
sfolderName
, regardless of their
write permissions. The result for read-only files follows the practices of the
operating system.
removes the
specified folder and returns a status of status
= rmdir(___)1
if the operation
is successful. Otherwise, rmdir
returns
0
. Warnings and errors are not thrown to the Command
Window. You can use this syntax with any of the input argument combinations in
the previous syntaxes.
Examples
Input Arguments
Output Arguments
Tips
You can use
rmdir
to create folders in remote locations. To write to a remote location,folderName
orparentName
must contain the full path of the file specified as a uniform resource locator (URL) of the form:schema_name://path_to_file/folderName
or
schema_name://path_to_file/parentName
It is also valid to use one or three "slash" (
/
) characters betweenschema_name
andpath_to_file
. For example:schema_name:/path_to_file/folderName
or
schema_name:///path_to_file/parentName
Based on your remote location,
schema_name
can be one of the values in this table.File System schema_name
Amazon S3™ s3
Windows Azure® Blob Storage wasb
,wasbs
HDFS™ hdfs
As with local folders,
rmdir
cannot remove nonempty virtual folders unless you specify thes
flag. Some file services do not support empty folders. On these services, ifrmdir
removes folders and leaves their parent folder empty, then the parent folder will be removed as well. For more information, see Work with Remote Data.
Alternative Functionality
In the Current Folder browser, right-click the folder name and select Delete from the context menu. To open the Current Folder browser, use the Current Folder Browser command.