File.CreateDir
Skip to content
mnscript
StringResult File.CreateDir(string, string) 

Description ​

Created a directory.

Arguments ​

string - The directory to create the directory.
string - The directory name to create.

Returns ​

StringResult - A StringResult representing the success/failure of the operation.

Example ​

msc
using File;
using Console;
using System;
using Application;

// Requests Admin Permission 
Application.RequestAdminPrivilege();

// Creates the directory "Files" in "r/documents".

StringResult result = File.CreateDir("r/documents", "Files");

if(result.GetResult()){
    Console.WriteLine("The directory was successfully created!");
}else{
    // If the directory could not be written, the result string contains the reason.
    Console.WriteLine("Error: "..result.GetString());
}