guile-user
[Top][All Lists]
Advanced

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

Re: System commands with error escaping


From: Thien-Thi Nguyen
Subject: Re: System commands with error escaping
Date: Thu, 27 Nov 2014 07:45:26 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

() "白熊 @相撲道" <address@hidden>
() Thu, 27 Nov 2014 00:18:22 +0300

   The problem with this is, when configure fails for example due
   to an error, I don't catch the error and next command gets
   executed... But I need to catch the error and stop Guile from
   proceeding, so I see what happened.

   How can I best do this? 

Personally, i use ‘(ttn-do zzz subprocess) call-process’, from
package ttn-do (http://www.gnuvola.org/software/ttn-do/).  Here is
its description (excerpt from .info file):

 -- Scheme Procedure: call-process program [keyword value…]
          Keywords: inp, outp, errp, norm, args

     Call PROGRAM synchronously in separate process.  Unless given
     ‘#:outp 0’, wait for PROGRAM to terminate and return a numeric exit
     status.

     ‘#:inp (current-input-port)’
          Input port.  ‘#f’ means ‘/dev/null’.

     ‘#:outp (current-output-port)’
          Output port.  ‘#f’ means discard output; 0 (zero) means
          discard, don’t wait for PROGRAM to terminate, and return ‘#f’.

     ‘#:errp (current-error-port)’
          Error output port.  ‘#f’ means discard output.

     ‘#:norm #f’
          Non-‘#f’ means PROGRAM and ARGS should be passed through
          ‘args->normalized-list’.

     ‘#:args ()’
          List of additional args to pass to PROGRAM.

See also ‘make-buffered-caller’ in that module for a more involved
(albeit still synchronous) interface.

-- 
Thien-Thi Nguyen
   GPG key: 4C807502
   (if you're human and you know it)
      read my lisp: (responsep (questions 'technical)
                               (not (via 'mailing-list)))
                     => nil

Attachment: signature.asc
Description: PGP signature


reply via email to

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