GNU bug report logs - #15228
[PATCH] Close output port of I/O pipes

Previous Next

Package: guile;

Reported by: Josep Portella Florit <jpf <at> primfilat.com>

Date: Sat, 31 Aug 2013 08:31:01 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: Amirouche Boubekki <amirouche <at> hypermove.net>
To: 15228 <at> debbugs.gnu.org
Subject: bug#15228: making open-process public
Date: Sat, 03 Sep 2016 09:33:32 +0200
Wingo wrote:

> We could just expose `open-process' from (ice-9 popen) to start with.

AFAIK, that's what Mark wants.

Here is an example use of `open-process' to wrap `html2text':


   (use-modules (ice-9 popen))

   (define open-process (@@ (ice-9 popen) open-process))

   (define (html2text string)
     (with-error-to-file "/dev/null"
       (lambda ()
         (call-with-values (lambda () (open-process OPEN_BOTH 
"html2text"))
           (lambda (read-port write-port pid)
             (display string write-port)
             (close-port write-port)
             (let ((str (read-string read-port)))
               (close-port read-port)
               (waitpid pid)
               str))))))

IIUC to achieve this goal, I need to make `open-process' public
in `ice-9 popen` module and add documentation for it?

Is that correct?




This bug report was last modified 4 years and 12 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.