[Top][All Lists]

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

Re: [gforth] How to get stdout into gforth

From: Anton Ertl
Subject: Re: [gforth] How to get stdout into gforth
Date: Fri, 26 Jan 2018 10:00:53 +0100
User-agent: NeoMutt/20170113 (1.7.2)

On Thu, Jan 25, 2018 at 02:49:02PM -0800, Dennis Ruffer wrote:
> Say I want to do something like this: 
> s" cd .. ; pwd" system /home/druffer
> How do I get the output of pwd back into gforth?

You would use OPEN-PIPE instead of SYSTEM, but I don't have an example.

> I see infile-execute, but I don’t see an examples for me to try.

INFILE-EXECUTE is for making any file temporarily the standard input
(so that KEY reads from this file).  But for your problem, you need to
get the output of pwd into gforth.  A pipe does that.

> Is that the right path, or is there another?

You could use the C interface to call chdir(), getcwd(), and then
somehow chdir() back.

- anton

reply via email to

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