{{fbdoc item="title" value="RMDIR"}}----
Removes a folder/directory from the file system

{{fbdoc item="syntax"}}##
	[[KeyPgDeclare declare]] [[KeyPgFunction function]] **Rmdir** ( [[KeyPgByref byref]] //folder// [[KeyPgAs as]] [[KeyPgConstQualifier const]] [[KeyPgString string]] ) [[KeyPgAs as]] [[KeyPgLong long]]
##
{{fbdoc item="usage"}}##
	//result// = **Rmdir**( //folder// )
##
{{fbdoc item="param"}}
	##//folder//##
		The folder/directory to be removed.

{{fbdoc item="ret"}}
	Returns zero (0) on success, and negative one (-1) on failure.

{{fbdoc item="desc"}}
	Removes a folder from the file system. The function will fail if the folder is not empty.

{{fbdoc item="ex"}}
{{fbdoc item="filename" value="examples/manual/system/rmdir.bas"}}%%(freebasic)
Dim pathname As String = "foo\bar\baz"
Dim result As Integer = RmDir( pathname )

If 0 <> result Then Print "error: unable to remove folder " & pathname & " in the current path."
%%

{{fbdoc item="target"}}
	- Linux requires the //folder// case matches the real name of the file. Windows and DOS are case insensitive. 
	- Path separators in Linux are forward slashes / . Windows uses backward slashes \ but it allows for forward slashes .  DOS uses backward  \ slashes. 

{{fbdoc item="diff"}}
	- None

{{fbdoc item="see"}}
	- ##[[KeyPgShell Shell]]##
	- ##[[KeyPgChdir Chdir]]##
	- ##[[KeyPgMkdir Mkdir]]##

{{fbdoc item="back" value="CatPgOpsys|Operating System Functions"}}