I think I get it!
see this page ...
change after the comment @false, here is a sketch of the encapsulating code:
set_file_size(Path, Size) :- setup_call_cleanup( open(Path, update, S), ( stream_property(S, reposition(true)), % stream_property(S, position(Q)), % set_stream_position(S, Q), seek(S, Size, bof, Size), set_end_of_stream(S) ), close(S)).
It works, but relies on seek / 4 builtin. I cannot fully determine the status of such compliance with the WRT ISO requirements. It is renamed to ISO IO, but does not meet the requirements ...
Those two commented lines served me to check the opaque position of the / 1 position. To request stream_position_data values
source share