[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ⎕FIO Buffer limit is 5000 Bytes
From: |
Kacper Gutowski |
Subject: |
Re: ⎕FIO Buffer limit is 5000 Bytes |
Date: |
Fri, 30 Oct 2020 13:25:28 +0100 |
On Thu, Oct 29, 2020 at 10:22:52PM +0100, Hans-Peter Sorge wrote:
the return size from ⎕FIO[24] / ⎕FIO[6] is limited to 5000B:
(...)
Should be: What ever it takes :-)
It's not limited to 5000B, it's just the default size and you can use
any other with dyadic form. ⎕FIO is fairly low-level and has very few
convenience wrappers like ⎕FIO[26]. Perhaps one doing popen and reading
the whole output like Perl's `` would be in order too, but it definitely
shouldn't be what ⎕FIO[6] does.
You can relatively easily do something like this:
∇ bytes←read_to_eof fd ;buf
[1] bytes←0⍴0
[2] loop:
[3] →(⎕FIO['feof'] fd)/0
[4] buf←⎕FIO['fread'] fd
[5] →(0≡buf)/loop
[6] ⎕ES(1≠⍴⍴buf)/⎕FIO['strerror'] buf
[7] bytes←bytes,buf
[8] →loop
∇
(It could be a one-liner if API were designed a bit better,
but it's still workable.)
-k