TMBASIC
Documentation
Docs
GitHub
TMBASIC Documentation
►
Procedures: Files
CreateDirectory
Procedure
Creates a directory, and any parent directories in the path as needed.
Declaration
sub CreateDirectory(path as String)
Parameters
path
as
String
— Directory path.
Possible error codes
ERR_ACCESS_DENIED
ERR_DISK_FULL
ERR_IO_FAILURE
ERR_PATH_TOO_LONG
Example
Code
' create a new subdirectory in the current directory
CreateDirectory
"testdir"
' create a file in that directory
dim filePath = PathCombine([
"testdir"
,
"test.txt"
])
WriteFileText filePath,
"hello world!"
' delete the directory and the file inside it
DeleteDirectory
"testdir"
, true