Skip to main content

Module windows_core

Module windows_core 

Source
Expand description

The machinery Windows shells share (path handling, external execution, redirect I/O). The shared Windows shell machinery.

PowerShell and cmd both need the same things to run a Windows command: resolve a name through the command table, record the invocation as a real process, execute it with the standard streams, and finish the process record — plus Windows path handling and redirect I/O. This module is the single implementation of that machinery; the shells keep their own languages, builtins, and parsing, and delegate the rest here.

Functions§

display_path
The Windows display form of an engine path: C:\Users\Rey.
read_redirect
Reads a redirect input file’s bytes.
resolve_path
Resolves a path argument against a working directory, accepting Windows path syntax: backslashes, drive prefixes (C:\Users\Rey), forward slashes, and trailing separators are all normalized to the engine’s slash form.
run_external
Runs one external command: resolves it through the command table, records the invocation in the process namespace (tasklist observes it), executes it with the given streams, and finishes the record.
write_redirect
Writes redirect output to the virtual filesystem, creating the file (under its parent, which must exist) when needed.