If it's broken...

The top level definition for 2!:2 is at
https://github.com/jsoftware/jsource/blob/master/jsrc/x.c#L90

(And, remember, line 4 of those .c files identifies the purpose of the
file. And, in the current versions, if you can't find a function
definition, try pasting a "jt" at the front of the name, because
there's a bunch of defines set up for that abstraction).

Anyways, the implementation itself is at the bottom of xh.c --
https://github.com/jsoftware/jsource/blob/master/jsrc/xh.c#L146

If it doesn't work on linux, it should be easy enough to submit a pull
request with a description of the details of the issue and a fix for
it.

(If you're new to the source code, you can use cpp or gcc -E to expand
the macros to get an idea about where to focus your attention. Expect
to skip over a lot of garbage if you use this, of course...)

Thanks,

-- 
Raul


On Mon, Mar 5, 2018 at 5:15 AM, bill lam <bbill....@gmail.com> wrote:
> Last time check, those foreign conjunctions did not work under linux. It
> was a long standing bug but not fixed.
>
> On Mon, Mar 5, 2018, 5:16 PM Nick S <simic...@gmail.com> wrote:
>
>> ssh can be run without pty allocation, the remote command can just be run
>> under pipes, for openssh, the option is -T if I read the manual pages
>> correctly.  The real question is whether the program you want to run
>> remotely needs a pty (Or the signal processing changes you can get from the
>> pry). Certainly most of the oldstyle tools run fine without a pty - bash,
>> ssh itself, grep, sed, and so forth don't need a pty. vi and such
>> might...but many such tools have a paper tty mode left over from the dark
>> ages when the TI Silent 700 was an advanced terminal. And that means no
>> curses, no pty needed. The rule, to me, is that if the command will run in
>> a pipeline where it gets its input from a pipe and the output can go to a
>> pipe, it probably runs without caring about a pty.
>>
>>
>>
>> In my former life I did a metric ton of using ssh to run remote commands
>> under program control to provide secure remote access to programs/systems
>> while minimizing the chance of intercept. Centralized security logging, for
>> example.  So the real question is not about ptys and scraping full screen
>> programs.
>>
>> The real question is, can I get a filehandle for stdin, stdout, and stderr
>> and then use the appropriate file I/O primitives to send data to the remote
>> process and get data from the process.
>>
>> My guess is that, under the covers, 2!:2 is used to create the ssh
>> co-process.  The raw foreign doc says it returns filehandles that are bound
>> to standard input, output and error. If you can't get what you want from
>> the library, well, most of the foreign primitives are not so hard to use
>> directly.
>>
>> Do remember that this sort of co-process creation is only supported on
>> Unix. You may not care whether your program runs under android or Windows,
>> but this makes it non-portable.  Yes, I think it is a bad thing that
>> Windows does not support the native Unix process structure as a standard
>> optional thing.  There was movement that way for a bit, but that was
>> abandoned, I think. It might run under cygwin.
>>
>>
>>
>> On Mar 3, 2018 08:15, "Raul Miller" <rauldmil...@gmail.com> wrote:
>>
>> You are correct.
>>
>> There is a lot of OS specific code needed for PTYs, and most everyone
>> has other higher priorities than working through all those issues.
>>
>> Thanks,
>>
>> --
>> Raul
>>
>> On Sat, Mar 3, 2018 at 6:30 AM, Omar Passos Torres de Almeida
>> <omar...@gmail.com> wrote:
>> > Thanks!
>> > I know those technics, but i was thinking in something coded in pure J or
>> > some addon. I think not exists something like those in J.
>> >
>> > Omar
>> >
>> >
>> > On 03/02/2018 11:25 PM, Raul Miller wrote:
>> >>
>> >> Working with ptys is kind of tricky, you'll want a program that
>> >> specializes in that, like expect or maybe even something like tmux.
>> >>
>> >> https://en.wikipedia.org/wiki/Expect
>> >>
>> >> https://en.wikipedia.org/wiki/Tmux
>> >>
>> >> If you're working with tmux, for example, you can use tmux send-keys
>> >> to "type" things into your ssh session.
>> >> https://ricochen.wordpress.com/2011/11/14/tmux-techniques-by-example/
>> >> looks like it has some plausible examples of this.
>> >>
>> >> I hope this helps,
>> >>
>> >
>> > ----------------------------------------------------------------------
>> > For information about J forums see http://www.jsoftware.com/forums.htm
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to