‘Programming with Unicon’ p. 394 states under reads(f:&input, i:1) : string?:
‘If i is -1, reads() reads and produces the entire file as a string.’
If I write:
fn := "KBDAMD64.DLL"
kf := open(fn, "ru")
reads(kf, -1)
the code compiles under Unicon 13.1 without error, but the following runtime error occurs:
Run-time error 205
File test.icn; Line 12
invalid value
offending value: -1
Traceback:
main()
reads(file(KBDAMD64.DLL),-1) from line 12 in test.icn
It seems that reads(f, i) with parameter i = -1 is not yet supported.
(I’m running Windows 10, 64-bit.)
Confirmed, it is a bug. The cause is the "u" flag. The current implementation doesn't support -1 with untrsalated mode. However, there is nothing that prevents -1 to be used in this case. Will be fixed.
fixed in [r5994]. Tested on Linux, please confirm that the fixs works under your OS as well.
Thanks for the report!
Related
Commit: [r5994]
Last edit: Jafar 2019-07-15