package spawn
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=d0a6262dbc582e70a116120a953c909338bce59ef43400ec8194e24c8d6f6c02
md5=6eaadbf8f9231415b51658da6b8b090f
README.md.html
SPAWN - spawning system process
Spawn is a small library exposing only one function: Spawn.spawn
. Its purpose is to start command in the background. Spawn aims to provide a few missing features of Unix.create_process
such as providing a working directory as well as improving error reporting and performance.
Errors such as directory or program not found are properly reported as Unix.Unix_error
exceptions, on both Unix and Windows.
On Unix, Spawn uses vfork
by default as it is often a lot faster than fork. There is a benchmark comparing Spawn.spawn
to Unix.create_process
in spawn-lib/bench
. If you don't trust vfork
, you can set the environment variable SPAWN_USE_FORK
to make Spawn use fork
instead.
Portability
Spawn is expected to be fully portable. However, so far it has only been tested on Linux, OSX and Windows.