bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ⎕FIO Buffer limit is 5000 Bytes


From: Dr . Jürgen Sauermann
Subject: Re: ⎕FIO Buffer limit is 5000 Bytes
Date: Sun, 1 Nov 2020 20:48:13 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Hi Hans-Peter,

the result of an ⍎'ed command is the output of that command, normally
one (nested) APL string for every line of command output.

This requires that the command output can be represented as APL
strings. This is the case for "normal" text output which must then
be either normal ASCII or else UTF8-encoded.

In theory one could have used raw bytes instead of UTF8 encoded
APL characters, but in most cases (and especially for interactive use
cases) the current solution is more convenient since the result can
be displayed directly (at least for text output).

Best Regards,
Jürgen



On 10/31/20 4:10 PM, Hans-Peter Sorge wrote:
EIJHHH - never thought about it - COOOL.


⍝IBM APL:
     ⍎ ')HOST ls'
VALUE ERROR
      )HOST ls
            ^
      ⍎')HOST ls'
                 ^
⍝ GNU-APL:
	l ← ⍎ ')HOST ls -1'
And it works:-)) Makes life much easier.

	f ← ⍎ ')HOST cat filename'
⍝ returns the file as nested vector
⍝ No intermediate file required.

⍝ Does not like binary data:
      ⍴⍎')HOST cat /OTH/APL/trunk/src/apl-Symbol.o'                                                                                                                                                                                          
Bad UTF8 string: 0x48 0x8B 0x45 0xD8 0x48 0x83 0xC0 0x30 0xEB 0x05 0xB8 at UCS_string.cc:120 ..... 



doc/apl.info (incorrectly) reads:
snip
Like system commands, user-define commands can only be executed in immediate
execution mode and not from user-defined functions or from ⍎.
/snip


A last thought:
How to connect apl-command_line to host-stdin? Like
        &⍞ ← 'test test test' 
	⍎ ')HOST &0  > data_entry_from_apl'

OK - Just a weekend. Asking too much:-)

Best Regards
Hans-Peter




 

Am 31.10.20 um 14:39 schrieb Dr. Jürgen Sauermann:
Hi,

On 10/30/20 6:14 PM, Kacper Gutowski wrote:
On Fri, Oct 30, 2020 at 02:34:35PM +0100, Dr. Jürgen Sauermann wrote:
There is also ⎕FIO[26] which reads an entire file, but I am not sure how it works with popen()ed streams.

It doesn't at all because it takes a path which additionally needs to be a regular file because it's mmaped rather than read.

For the record, something like ⍎')HOST ...' might sometimes be practical.

-k
That is actually a cool idea: run your pipe or program with )HOST, forward the
output into some /tmp/xxx and read back /tmp/xxx. It also gives you some more
control over using stdout, stderr, or both from the executed program .

Jürgen




reply via email to

[Prev in Thread] Current Thread [Next in Thread]