A non-regular file is a device (such as a keyboard), or a pipe. Text_IO can be used for reading and writing. Writing is not affected and the sequence of characters output is identical to the normal file case, but for reading, the behavior of Text_IO is modified to avoid undesirable look-ahead as follows:
An input file that is not a regular file is considered to have no page
Ascii.FF characters (the character normally used for a
page mark) appearing in the file are considered to be data
characters. In particular:
Skip_Linedo not test for a page mark following a line mark. If a page mark appears, it will be treated as a data character.
Falseif there is a page mark at the end of the file.
Output to non-regular files is the same as for regular files. Page marks
may be written to non-regular files using
New_Page, but as noted
above they will not be treated as page marks on input if the output is
piped to another Ada program.
Another important discrepancy when reading non-regular files is that the end
of file indication is not "sticky". If an end of file is entered, e.g. by
then end of file
is signalled once (i.e. the test
True, or a read will
End_Error), but then reading can resume
to read data past that end of
file indication, until another end of file indication is entered.