In this task, the job is to create a new empty file called "output.txt" of size 0 bytes
and an empty directory called "docs". This should be done twice: once "here", i.e. in the current working directory and once in the filesystem root.

using System;
using System.IO;
 
module CreateFile
{
    Main() : void
    {
        unless (File.Exists("output.txt")) File.Create("output.txt");         // here
        // returns a FileStream object which we're ignoring
        try {
            unless (File.Exists(@"\output.txt")) File.Create(@"\output.txt"); // root
        }
        catch {
            |e is UnauthorizedAccessException => Console.WriteLine(
            "Cannot create file in root directory without Administrator priveleges.")
        }
 
        unless (Directory.Exists("docs")) Directory.CreateDirectory("docs");
        // returns a DirectoryInfo object which we're ignoring
        unless (Directory.Exists(@"\docs")) Directory.CreateDirectory(@"\docs");
        // no Exception for directory creation
    }
}