Logo

Programming-Idioms

  • Elixir
  • D

Idiom #155 Delete file

Delete from filesystem the file having path filepath.

import std.file;
try
    remove(filepath);
catch (FileException fe)
    writeln(fe.msg);

try /catch can be used to track exceptions.
File.rm(filepath)
with Ada.Directories;
Ada.Directories.Delete_File (filepath);

New implementation...
< >
programming-idioms.org