openFileBOM/1 and extra empty strings on readLine()
Posted: 21 May 2018 20:48
From the documentation, I expect openFileBOM/1 should behave the same as openFile8/1. However, when reading a simple text file with no byte-order marks successive readLine() statements return text and an empty string when the file is opened with openFileBOM/1.
Is this how openFileBOM/1 should behave?
The output above is generated by this test code:
Is this how openFileBOM/1 should behave?
Code: Select all
Output using openFileBOM(FN):
zero
one
two
three
Output using openFile8(FN):
zero
one
two
three
Code: Select all
test() :-
FN = @"SimpeTestFile.txt",
In1 = inputStream_file::openFileBom(FN),
stdio::write("\n\nOutput using openFileBOM(FN):"),
In1:repeatToEndOfStream(),
stdio::write("\n", In1:readLine()),
In1:endOfStream(),
In1:close(),
In2 = inputStream_file::openFile8(FN),
stdio::write("\n\nOutput using openFile8(FN):"),
In2:repeatToEndOfStream(),
stdio::write("\n", In2:readLine()),
In2:endOfStream(),
!,
In2:close().
test().