silk.platform.windows.process_image.

Interactive Windows process execution: inherit the terminal, environment, and working directory, wait for the image, and return its exact exit status to the shell.

Import as WindowsProcessImage with import silk.platform.windows.process_image as WindowsProcessImage.

Public declarations: 6.

setVariableBytes#

silk
pub effect fn setVariableBytes(name: &[u8], value: &[u8]) -> bool ! OutOfMemoryError ? &mut Allocator

Sets a live Windows environment variable from canonical WTF-8 host bytes, replacing its value. Returns false for an empty name, = in the name, NUL, invalid WTF-8, or an OS refusal. Allocation failure remains an Effect. Previously captured HostInput snapshots do not change.

setVariable#

silk
pub effect fn setVariable(name: string, value: string) -> bool ! OutOfMemoryError ? &mut Allocator

Sets a live Windows environment variable from text, replacing its value. Returns false for an empty name, = in the name, NUL, or an OS refusal. Allocation failure remains an Effect. Previously captured HostInput snapshots do not change.

setVariableDefaultBytes#

silk
pub effect fn setVariableDefaultBytes(name: &[u8], value: &[u8]) -> bool ! OutOfMemoryError ? &mut Allocator

Sets a default from canonical WTF-8 host bytes, preserving an existing value, including empty. Returns false for invalid WTF-8, NUL, an empty name, = in the name, or an OS refusal. The presence check and update are separate calls; concurrent environment writers may race.

setVariableDefault#

silk
pub effect fn setVariableDefault(name: string, value: string) -> bool ! OutOfMemoryError ? &mut Allocator

Sets a default environment variable from text, preserving an existing value, including empty. Returns false for NUL, an empty name, = in the name, or an OS refusal. The presence check and update are separate calls; concurrent environment writers may race.

replace#

silk
pub effect fn replace(program: &Path, arguments: &[Bytes], directory: Option<&Path>) -> bool ! OutOfMemoryError ? &mut Allocator

Runs an explicit executable with inherited standard streams and environment, in directory when one is given and otherwise in this process's working directory. Returns false if setup fails. On successful launch it waits and exits with the child's DWORD.

execute#

silk
pub effect fn execute(program: &Path, arguments: &[Bytes], directory: Option<&Path>) -> Option<u32> ! OutOfMemoryError ? &mut Allocator

Runs an explicit executable with inherited standard streams and environment, in directory when one is given and otherwise in this process's working directory, waits for it, and returns its DWORD exit status.

Details#

The executable gets duplicates of this process's standard handles and no others. While it runs, this process ignores Ctrl+C, so the child handles it.

Gotchas#

Returns none when setup fails, or the executable is a batch script (.bat or .cmd), which would need a shell.

Category: Windows platform.

Profiles: x86_64-pc-windows-msvc.

View the source of this page