Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
20
Task/Delete-a-file/Nemerle/delete-a-file.nemerle
Normal file
20
Task/Delete-a-file/Nemerle/delete-a-file.nemerle
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
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");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue