Previous Topic: CopyTree - Copy a Directory TreeNext Topic: CreateFile - Create a New File


CreateDirectory or MkDir - Create a New Directory

Valid on NetWare, Symbian OS, UNIX, Windows and Windows CE

The CreateDirectory or MkDir function creates a new directory.

This file content function has the format:

MkDir(pathstring as String) as Boolean
CreateDirectory(pathstring as String) as Boolean
pathstring

Specifies the name of the directory to create.

On successful completion, the function returns TRUE; otherwise, it returns FALSE.

Example: CreateDirectory function

This example creates a backup directory and copies autoexec.bat to the directory and renames it to autoexec.bat.

HELP_GETFILEATTRIBUTES

If Not(ExistDirectory("c:\backup")) then CreateDirectory("c:\backup")
CopyFile("c:\autoexec.bat", "c:\backup\autoexec.bat") 
RenameFile("c:\backup\autoexec.bat", "c:\backup\autoexec.bak")