rmdir

Removes the directory dir.

Syntax

rmdir dir

rmdir(dir)

[status, msg1, msg2] = rmdir(dir)

Inputs

dir
Name of directory to be removed.
Type: string

Outputs

status
Returns 1 if successful; returns 0 if not successful.
msg1
If status is 1 (successful) msg1 is empty. If status is 0 (unsuccessful) msg1 contains an error mesage.
msg2
If status is 1 (successful) msg2 is empty. If status is 0 (unsuccessful) msg2 contains additional information.

Examples

Simple rmdir successful example:
rmdir('C:/testdirectory')
ans = 1
Simple rmdir unsuccessful example with fail outputs:
[status, msg1, msg2] = rmdir('C:/testdirectory')
status = 0
msg1 = Problem removing directory
msg2 = rmdir