[m-users.] Pass stream or string to standard input of shell command

Peter Wang novalazy at gmail.com
Tue Mar 17 10:51:22 AEDT 2020


On Mon, 16 Mar 2020 13:56:10 +0100, Dirk Ziegemeyer <dirk at ziegemeyer.de> wrote:
> Hello,
> 
> is it possible to pass an io.text_output_stream or string to the standard input of an operating system shell command called from within Mercury?
> 
> Instead of first writing output to a large text file on disk and then compressing it by calling gzip with
> 
> io.call_system("gzip FILE", Result, !IO)
> 
> I would rather pass the uncompressed stream or string directly to the standard input of gzip.

You will need to write some foreign code as Volker says.
You can get some inspiration from here if you like
https://github.com/wangp/bower/blob/master/src/process.m

Peter


More information about the users mailing list