ISO mode: put(file) does not advance the file pointer
The subsequent test program creates a file, where the first line has only the last character, whereas the second line has all characters.
program fileGetTest(textfile);
var
textfile: text;
begin
rewrite(textfile);
textfile^ := 'O';
put(textfile);
textfile^ := 'h';
put(textfile);
textfile^ := 'a';
put(textfile);
textfile^ := 'b';
put(textfile);
writeln(textfile);
write(textfile, 'O');
write(textfile, 'h');
write(textfile, 'a');
writeln(textfile);
end.
Compiled with "fpc -Miso test.pas". executed with "./test test.txt" check with "cat test.txt":
b
Oha
The addition of assign, flush or close as well as various compiler switches did not change the result. platform: macOS 26-arm. fpc: 3.2.2 installed through macports.