DEFINITION MODULE TempFiles;

        (********************************************************)
        (*                                                      *)
        (*               Creating temporary files               *)
        (*                                                      *)
        (*                                                      *)
        (*  Programmer:         Peter Moylan                    *)
        (*  Started:            5 August 2023                   *)
        (*  Last edited:        11 August 2023                  *)
        (*  Status:             OK                              *)
        (*                                                      *)
        (********************************************************)


FROM FileOps IMPORT ChanId;


PROCEDURE MakeNewFilename (BaseName, tail: ARRAY OF CHAR;
                       VAR (*OUT*) NewName: ARRAY OF CHAR);

    (* Creates a file name of the form BaseNamexxxtail, where xxx is    *)
    (* chosen such that a file of that name does not already exist.     *)
    (* Note that BaseName and tail can include punctuation.             *)

PROCEDURE OpenNewOutputFile (BaseName, tail: ARRAY OF CHAR;
                       VAR (*OUT*) NewName: ARRAY OF CHAR;
                                               Visible: BOOLEAN): ChanId;

    (* Creates a file name of the form BaseNamexxxtail, where xxx is    *)
    (* chosen such that a file of that name does not already exist, and *)
    (* opens that file.                                                 *)
    (* Note that BaseName and tail can include punctuation.             *)

END TempFiles.

