Logo

Programming-Idioms

  • PHP
  • Fortran

Idiom #155 Delete file

Delete from filesystem the file having path filepath.

open (10,file=filepath,status="old", iostat=ierr)
if (ierr == 0) close (10,status="delete")

You cannot delete directly, but you can delete upon closing.
unlink($filepath);
with Ada.Directories;
Ada.Directories.Delete_File (filepath);

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