From Liberty BASIC Family
Jump to navigation Jump to search
Supported in Just BASIC Supported in Liberty BASIC Not supported in Liberty BASIC 5 Supported in Run BASIC


This function attempts to remove the empty directory specified in dirName. If successful, the function returns 0; otherwise, a system error code is returned.
See MSDN for a list of System Error Codes (0-499)
See also MKDIR() to make a directory.


  1. retValue = rmdir("dirName")


To confirm that the directory was successfully removed, use this test to check the value returned by the function:
    result =  rmdir("dirName")
    if result <> 0 then notice "Directory not removed."


' To remove a folder named "temp" in the current directory
' and confirm the removal:

    result = rmdir("temp")
    ' Check if folder is existing
    if result = 2 then print "Folder does not exist."

    ' Test if successful
    if result <> 0 then
        print "Folder was not removed."
        print "Folder has been removed from ";DefaultDir$
    end if


Useful Procedures

' Place a useful function or sub using this keyword here