Skip to content
Snippets Groups Projects
Commit b4eaba71 authored by sof's avatar sof
Browse files

[project @ 1998-07-20 16:20:46 by sof]

- Added a word of warning on using 'executeFile' *and* have
  parent and child share open files.
parent b4e8611b
No related branches found
No related tags found
No related merge requests found
...@@ -291,8 +291,19 @@ be written by hand. Care must be taken to ensure that the search path ...@@ -291,8 +291,19 @@ be written by hand. Care must be taken to ensure that the search path
is extracted from the original environment, and not from the is extracted from the original environment, and not from the
environment to be passed on to the new image. environment to be passed on to the new image.
NOTE: In general, sharing open files between parent and child
processes is potential bug farm, and should be avoided unless you
really depend on this `feature' of POSIX' @fork()@ semantics. Using
Haskell, there's the extra complication that arguments to
@executeFile@ might come from files that are read lazily (using
@hGetContents@, or some such.) If this is the case, then for your own
sanity, please ensure that the arguments to @executeFile@ have been
fully evaluated before calling @forkProcess@ (followed by
@executeFile@.) Consider yourself warned :-)
A successful @executeFile@ overlays the current process image with A successful @executeFile@ overlays the current process image with
a new one, so it only returns on failure. a new one, so it only returns on failure.
<tscreen><verb> <tscreen><verb>
runProcess :: FilePath -- Command runProcess :: FilePath -- Command
-> [String] -- Arguments -> [String] -- Arguments
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment