FUNCTION REFERENCE

rmdir

Remove an empty directory or a directory tree.

Remove an empty directory or a directory tree.

Syntax

status = rmdir(folder)

Syntax

[status, message, id] = rmdir(folder, 's')

The s option removes contents recursively. Without outputs, failures raise errors. Recursive removal checks cancellation and is bounded to 64 levels and 10000 entries; cancellation or failure may leave a partly removed tree.

Example

d=tempname(pwd); mkdir(d); rmdir(d)   % no output

Differences from MATLAB: Local paths only; recursive operations have explicit bounds and cooperative cancellation.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.