Retro Rocket OS
BASIC-Powered Operating System
Loading...
Searching...
No Matches
RMDIR Keyword
RMDIR string-expression

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.
Remarks
Paths are case-insensitive.
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

RMDIR "old_data"

Remove a directory by absolute path

RMDIR "/projects/archive"

Create then remove (must be empty)

MKDIR "tmp"
RMDIR "tmp"

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