with Io;
package File_Operations is

    -- This package exports cleaner versions of the file opening/creating
    -- operations in the Io package. They perform exception handling and
    -- error reporting.

    procedure Open_To_Read  
                 (File_Name : in String := ">> FULL PATHNAME <<";
                  The_File : out Io.File_Type;  
                  Response : in String := "<PROFILE>");
    -- This procedure attempts to open a file for reading with the
    -- specified name. If this fails, it reports an error and raises
    -- an exception.

    procedure Open_To_Write  
                 (File_Name : in String := ">> FULL PATHNAME <<";
                  The_File : out Io.File_Type;  
                  Response : in String := "<PROFILE>");
    -- This procedure attempts to open a file for writing with the
    -- specified name. If this fails, it then attempts to create a
    -- file for writing with the specified name. If this fails it
    -- reports an error and raises an exception.

    procedure Close  
                 (This_File : in out Io.File_Type;
                  Response : in String := "<PROFILE>");
    -- If the file is open, closes it. If the file is not open,
    -- catches the exception and does nothing. Using this procedure
    -- is therefore always a safe operation.

    File_Problem : exception;

end File_Operations;