Menu

#300 reads(f, -1) not supported under Unicon 13.1

None
closed-fixed
Jafar
None
5
2021-09-21
2019-07-03
Kim
No

‘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.)

Discussion

  • Jafar

    Jafar - 2019-07-15
    • status: open --> pending
    • assigned_to: Jafar
    • Group: -->
     
  • Jafar

    Jafar - 2019-07-15

    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.

     
  • Jafar

    Jafar - 2019-07-15
    • status: pending --> pending-fixed
     
  • Jafar

    Jafar - 2019-07-15

    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
  • Jafar

    Jafar - 2021-09-21
    • status: pending-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB