chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] close-input-pipe return value


From: Zbigniew
Subject: [Chicken-users] close-input-pipe return value
Date: Mon, 20 Jun 2005 11:51:19 -0500

close-input-pipe discards the return value of the process you invoked,
so you can't figure out if it failed.  It only signals an error (via
exception) if the system call failed.

In Perl, close(pipe) will fail on a non-zero exit code (though the
code is returned out of band, in $?).

An easy fix is to have close-input-pipe return the value from pclose()
(stored in the variable "r"), since it currently returns nothing at
all.  Semantically it makes sense to return #f on failure, but where
would you pass the code back?  Out-of-band variables, like in Perl,
seem wrong in Scheme.

Of course, with-input-from-pipe and friends would still not signal an
error, this way.  I can live with that.  They could if an exception
were signaled, or a procedure of your choosing were called upon
close-input-pipe failure, but both seem a bit heavyweight.

I know PROCESS and PROCESS-WAIT can retrieve process codes, but I
don't want to use them for various reasons.

Any suggestions?

Zb




reply via email to

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