Closed infradig closed 1 year ago
Thanks for noticing. Tired eyes and too much multitasking. Fixed now. Unfortunately, it seems that most Prolog systems fail to correctly handle errors from devices.
SWI and Trealla (at least) only fail on the close. The writes don't generate a testable error at least on Linux.
On Tue, Aug 1, 2023 at 5:10 PM Paulo Moura @.***> wrote:
Thanks for noticing. Tired eyes and too much multitasking. Fixed now. Unfortunately, it seems that most Prolog systems fail to correctly handle errors from devices.
— Reply to this email directly, view it on GitHub https://github.com/LogtalkDotOrg/logtalk3/issues/178#issuecomment-1659702179, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFNKSERIFFOMLVTVI2KGLO3XTCTWFANCNFSM6AAAAAA27GCTPI . You are receiving this because you authored the thread.Message ID: @.***>
Itl seems adding a fflush() call to nl/1 was enough to trigger it. Makes sense.
On Tue, Aug 1, 2023 at 5:10 PM Paulo Moura @.***> wrote:
Thanks for noticing. Tired eyes and too much multitasking. Fixed now. Unfortunately, it seems that most Prolog systems fail to correctly handle errors from devices.
— Reply to this email directly, view it on GitHub https://github.com/LogtalkDotOrg/logtalk3/issues/178#issuecomment-1659702179, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFNKSERIFFOMLVTVI2KGLO3XTCTWFANCNFSM6AAAAAA27GCTPI . You are receiving this because you authored the thread.Message ID: @.***>
SWI and Trealla (at least) only fail on the close. The writes don't generate a testable error at least on Linux. …
Yes, that's one of the main issues. Makes sense to only get an error when the output is flushed. With the latest Trealla Prolog version:
$ tplgt
...
Trealla Prolog (c) Infradig 2020-2023, v2.23.38
?- catch((open('/dev/full', write, S), write(S, foo), close(S)), E, true).
E = error(io_error('No space left on device','<$stream>'(4)),close/1).
A lack of space error is indeed the expected error. Unfortunately, the ISO standard fails to specify the exact exception that should be throw in this case.
Whether by design or otherwise
os::full_device_path/1
is currently returning/dev/null
when it should be/dev/full
.