Task

Verify that a file called     input.txt     and   a directory called     docs     exist.



This should be done twice:  

   once for the current working directory,   and
   once for a file and a directory in the filesystem root.


Optional criteria (May 2015):   verify it works with:

   zero-length files
   an unusual filename:     `Abdu'l-Bahá.txt  


with Ada.Text_IO; use Ada.Text_IO;
 
procedure File_Exists is
   function Does_File_Exist (Name : String) return Boolean is
      The_File : Ada.Text_IO.File_Type;
   begin
      Open (The_File, In_File, Name);
      Close (The_File);
      return True;
   exception
      when Name_Error =>
         return False;
   end Does_File_Exist;
begin
   Put_Line (Boolean'Image (Does_File_Exist ("input.txt" )));
   Put_Line (Boolean'Image (Does_File_Exist ("\input.txt")));
end File_Exists;