MkDir Statement [Runtime]/text/sbasic/shared/03020411.xhpMkDir statementMkDir Statement [Runtime]Creates a new directory on a data medium.Syntax:MkDir Text As StringParameters:Text: Any string expression that specifies the name and path of the directory to be created. You can also use URL notation.If the path is not determined, the directory is created in the current directory.Example:Sub ExampleFileIO' Example for functions of the file organizationConst sFile1 as String = "file://c|/autoexec.bat"Const sDir1 as String = "file://c|/Temp"Const sSubDir1 as String ="Test"Const sFile2 as String = "Copied.tmp"Const sFile3 as String = "Renamed.tmp"Dim sFile as StringsFile = sDir1 + "/" + sSubDir1ChDir( sDir1 )If Dir(sSubDir1,16)="" then ' Does the directory exist ?MkDir sSubDir1MsgBox sFile,0,"Create directory"End IfsFile = sFile + "/" + sFile2FileCopy sFile1 , sFileMsgBox fSysURL(CurDir()),0,"Current directory"MsgBox sFile & Chr(13) & FileDateTime( sFile ),0,"Creation time"MsgBox sFile & Chr(13)& FileLen( sFile ),0,"File length"MsgBox sFile & Chr(13)& GetAttr( sFile ),0,"File attributes"Name sFile as sDir1 + "/" + sSubDir1 + "/" + sFile3' Rename in the same directorysFile = sDir1 + "/" + sSubDir1 + "/" + sFile3SetAttr( sFile, 0 ) 'Delete all attributesMsgBox sFile & Chr(13) & GetAttr( sFile ),0,"New file attributes"Kill sFileRmDir sDir1 + "/" + sSubDir1end sub' Converts a system path in URLFunction fSysURL( fSysFp as String ) as StringDim iPos As StringiPos = 1iPos = Instr(iPos,fSysFp, getPathSeparator())do while iPos > 0mid( fSysFp, iPos , 1,"/")iPos = Instr(iPos+1,fSysFp, getPathSeparator())loop' the colon with DOSiPos = Instr(1,fSysFp,":")if iPos > 0 then mid( fSysFp, iPos , 1,"|")fSysURL = "file://" & fSysFpEnd Function