12.9 Foreign access to Prolog IO streams
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Foreign Language Interface
        • Foreign access to Prolog IO streams
          • Get IO stream handles
          • Creating an IO stream
          • Interacting with foreign streams
          • Foreign stream error handling
          • Foreign stream encoding
          • Foreign stream line endings
          • Foreign stream position information
    • Packages

12.9.6 Foreign stream line endings

Text streams have a field newline that controls the handling of the newline convention. Note that inside Prolog all lines end with a single newline (\u000a, \n) code point. The values are described below. The default depends on the OS and can be manipulated using the newline(Mode) property of set_stream/2.

SIO_NL_DETECT
This mode may be enabled on an input stream. It causes the stream to read up to the first newline to set the newline mode accordingly.
SIO_NL_POSIX
Do not do any translation on input or output.
SIO_NL_DOS
Emit a newline (\n) as \r\n. Discard \r from the input.225The current implementation does not check that the character is followed by \n.