Program
Function proxy for an external program.
Constructor
Program value
Creates a program proxy.
Parameters
| Name | Type | Description |
|---|---|---|
value |
(Str | Sym | fs.Path) |
Program name or path. |
Example
Methods
(call) ...args …
Runs the program with the supplied command-line arguments.
Output is written to the configured streams. See External Programs for lookup, stream handling and pipeline behavior.
Parameters
| Name | Type | Description |
|---|---|---|
:stdin? |
(fs.Path | Iter[Value]) |
Source for standard input. |
:stdout? |
(fs.Path | Sink[Value]) |
Destination for standard output. |
:stderr? |
(fs.Path | Sink[Value] | :STDOUT:) |
Destination for standard error, or :STDOUT: to merge it with standard
output. |
:policy? |
Dict[{?signal: Signal | Int, ?grace: time.Duration | Int | Float, ?force: Bool}] |
Per-launch termination overrides: signal,
grace and force, as
with_policy takes them. |
:mode? |
(:LINE: | :CHUNK:) |
Output framing. Defaults to :LINE:. |
...args |
Command-line arguments. |
Errors
| Exception | Condition |
|---|---|
Error |
The program exited unsuccessfully |
Example
which() -> (fs.Path | nil)
Resolves the program without running it.
Returns
nil when the program is not found.