[Haskell-cafe] createProcess running non-existent programs

Andrew Cowie andrew at operationaldynamics.com
Mon Aug 13 10:16:50 CEST 2012

On Sun, 2012-08-12 at 23:18 -0700, Evan Laforge wrote:
> Yes, I ran into the same thing a while back.  The problem is that the
> subprocess has already been forked off before it runs exec() and finds
> out the file doesn't exist.

Given how astonishingly common it is to pass an invalid executable name
and/or path, wouldn't it be worth doing a quick probe to see if the file
exists before createProcess actually forks?

[It's not like the effort the OS is going to do for the stat is going to
be thrown away; whether that call pulls it up off of disk or the one
after the fork that exec will do doesn't matter]


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120813/a1156430/attachment.pgp>

More information about the Haskell-Cafe mailing list