RosettaCodeData/Task/Delete-a-file/Nemerle/delete-a-file.nemerle
2023-07-01 13:44:08 -04:00

20 lines
503 B
Text

using System;
using System.IO;
using System.Console;
module DeleteFile
{
Main() : void
{
when (File.Exists("input.txt")) File.Delete("input.txt");
try {
when (File.Exists(@"\input.txt")) File.Delete(@"\input.txt");
}
catch {
|e is UnauthorizedAccessException => WriteLine(e.Message)
}
when (Directory.Exists("docs")) Directory.Delete("docs");
when (Directory.Exists(@"\docs")) Directory.Delete(@"\docs");
}
}