Removes the specified directory from the filesystem.
- string-expression must evaluate to a directory name or path.
- The directory must be empty or an error is raised.
- Note
- . and .. are not supported in paths.
-
Use an absolute path when it starts with /; otherwise the path is relative to the current directory.
-
Change directory with CHDIR.
-
If removal fails, you can catch it with ON ERROR.
Examples
Remove a directory in the current folder
Remove a directory by absolute path
RMDIR "/projects/archive"
Create then remove (must be empty)
Notes
- RMDIR removes directories only. To delete a file, use DELETE.
- Attempting to remove a non-empty directory raises a runtime error.
- Ensure you have permission and that no required files are inside before removing.
See also:
MKDIR · DELETE · CHDIR