Go to the first, previous, next, last section, table of contents.
Static Semantics
-
The following subprograms provide for the control of the particular
default files that are used when a file parameter is omitted from a Get,
Put, or other operation of text input-output described below, or when
application-dependent error-related text is to be output.
-
procedure Set_Input(File : in File_Type);
-
Operates on a file of mode In_File. Sets the current default input file
to File.
-
The exception Status_Error is propagated if the given file is not open.
The exception Mode_Error is propagated if the mode of the given file is
not In_File.
-
procedure Set_Output(File : in File_Type);
procedure Set_Error (File : in File_Type);
-
Each operates on a file of mode Out_File or Append_File. Set_Output sets
the current default output file to File. Set_Error sets the current
default error file to File. The exception Status_Error is propagated if
the given file is not open. The exception Mode_Error is propagated if
the mode of the given file is not Out_File or Append_File.
-
function Standard_Input return File_Type;
function Standard_Input return File_Access;
-
Returns the standard input file, See section A.10 Text Input-Output, or an access value
designating the standard input file, respectively.
-
function Standard_Output return File_Type;
function Standard_Output return File_Access;
-
Returns the standard output file, See section A.10 Text Input-Output, or an access value
designating the standard output file, respectively.
-
function Standard_Error return File_Type;
function Standard_Error return File_Access;
-
Returns the standard error file, See section A.10 Text Input-Output, or an access value
designating the standard output file, respectively.
-
The Form strings implicitly associated with the opening of
Standard_Input, Standard_Output, and Standard_Error at the start of
program execution are implementation defined.
-
function Current_Input return File_Type;
function Current_Input return File_Access;
-
Returns the current default input file, or an access value designating
the current default input file, respectively.
-
function Current_Output return File_Type;
function Current_Output return File_Access;
-
Returns the current default output file, or an access value designating
the current default output file, respectively.
-
function Current_Error return File_Type;
function Current_Error return File_Access;
-
Returns the current default error file, or an access value designating
the current default error file, respectively.
-
procedure Flush (File : in out File_Type);
procedure Flush;
-
The effect of Flush is the same as the corresponding subprogram in
Streams.Stream_IO, See section A.12.1 The Package Streams.Stream_IO. If File is not explicitly specified,
Current_Output is used.
Erroneous Execution
-
The execution of a program is erroneous if it attempts to use a current
default input, default output, or default error file that no longer
exists.
-
If the Close operation is applied to a file object that is also serving
as the default input, default output, or default error file, then
subsequent operations on such a default file are erroneous.
NOTES
-
(23) The standard input, standard output, and standard error files
cannot be opened, closed, reset, or deleted, because the parameter File
of the corresponding procedures has the mode in out.
-
(24) The standard input, standard output, and standard error files are
different file objects, but not necessarily different external files.
Go to the first, previous, next, last section, table of contents.