CreateProcess Module
Module for creating and modifying CreateProcess<'TRes> instances.
You can manage:
- The command (ie file to execute and arguments)
- The working directory
- The process environment
- Stream redirection and pipes
- Timeout for the process to exit
-
The result and the result transformations (
map
,mapResult
)
More extensions can be found in the CreateProcess Extensions
Example
Command.RawCommand("file", Arguments.OfArgs ["arg1"; "arg2"])
|> CreateProcess.fromCommand
|> Proc.run
|> ignore
Functions and values
Function or value | Description |
Full Usage:
addOnExited f c
Parameters:
'a -> int -> 'b
-
Function to add on exit event
c : CreateProcess<'a>
-
The create process instance
Returns: CreateProcess<'b>
|
Execute the given function after the process has been exited and the previous result has been calculated.
|
Full Usage:
addOnFinally f c
Parameters:
unit -> unit
-
Function to add as a finally clause
c : CreateProcess<'a>
-
The create process instance
Returns: CreateProcess<'a>
|
|
Full Usage:
addOnSetup f c
Parameters:
unit -> 'a
-
Function to add on setup
c : CreateProcess<'b>
-
The create process instance
Returns: CreateProcess<'b>
|
|
Full Usage:
addOnStarted f c
Parameters:
unit -> unit
-
Function to add on started event
c : CreateProcess<'a>
-
The create process instance
Returns: CreateProcess<'a>
|
|
Full Usage:
addOnStartedEx f c
Parameters:
StartedProcessInfo -> unit
-
Function to add on started event
c : CreateProcess<'a>
-
The create process instance
Returns: CreateProcess<'a>
|
Execute the given function right after the process is started. PID for process can be obtained from p parameter (p.Process.Id).
|
Full Usage:
appendSimpleFuncs prepareState onStart onResult onDispose c
Parameters:
unit -> 'a
-
Function to override state
onStart : 'a -> Process -> unit
-
Function to override start
onResult : Async<'b> -> 'a -> Task<RawProcessResult> -> Async<'c>
-
Function to override result
onDispose : 'a -> unit
-
Function to override dispose
c : CreateProcess<'b>
-
The create process instance
Returns: CreateProcess<'c>
|
|
Full Usage:
copyRedirectedProcessOutputsToStandardOutputs c
Parameters:
CreateProcess<'a>
-
The process to copy output to standard output
Returns: CreateProcess<'a>
|
Copies std-out and std-err into the corresponding
|
Full Usage:
disableTraceCommand c
Parameters:
CreateProcess<'a>
-
The create process instance
Returns: CreateProcess<'a>
|
|
|
|
Full Usage:
ensureExitCodeWithMessage msg r
Parameters:
string
-
The message to use
r : CreateProcess<'a>
Returns: CreateProcess<'a>
|
|
Full Usage:
fromCommand command
Parameters:
Command
Returns: CreateProcess<ProcessResult<unit>>
|
Example
|
Full Usage:
fromRawCommand command args
Parameters:
FilePath
args : seq<string>
Returns: CreateProcess<ProcessResult<unit>>
|
Example
|
Full Usage:
fromRawCommandLine command windowsCommandLine
Parameters:
FilePath
windowsCommandLine : string
Returns: CreateProcess<ProcessResult<unit>>
|
Using BlackFox.CommandLine
Example
|
Full Usage:
getEnvironmentMap c
Parameters:
CreateProcess<'a>
-
The create process instance
Returns: EnvMap
|
|
Full Usage:
interceptStream target s
Parameters:
Stream
-
The target stream
s : StreamSpecification
-
The target stream specification
Returns: StreamSpecification
|
Intercept the given StreamSpecification and writes the intercepted data into target. Throws if the stream is not redirected (ie is Inherit).
|
|
|
Full Usage:
mapFilePath f c
Parameters:
FilePath -> FilePath
-
Function to override file path
c : CreateProcess<'a>
-
The create process instance
Returns: CreateProcess<'a>
|
|
Full Usage:
mapResult f c
Parameters:
'a -> 'b
-
Function to run result map through
c : CreateProcess<ProcessResult<'a>>
Returns: CreateProcess<ProcessResult<'b>>
|
|
Full Usage:
ofStartInfo p
Parameters:
ProcessStartInfo
Returns: CreateProcess<ProcessResult<unit>>
|
|
Full Usage:
redirectOutput c
Parameters:
CreateProcess<'a>
-
The create process instance
Returns: CreateProcess<ProcessResult<ProcessOutput>>
|
|
Full Usage:
redirectOutputIfNotRedirected c
Parameters:
CreateProcess<'a>
-
The create process instance
Returns: CreateProcess<'a>
|
Starts redirecting the output streams if they are not already redirected. Be careful when using this function. Using redirectOutput is the preferred variant
|
Full Usage:
replaceFilePath newFilePath c
Parameters:
FilePath
-
The new file path to use as a replacement
c : CreateProcess<'a>
-
The create process instance
Returns: CreateProcess<'a>
|
|
Full Usage:
setEnvironmentVariable envKey envVar c
Parameters:
string
-
The environment variable key
envVar : string
-
The environment variable value
c : CreateProcess<'a>
-
The create process instance
Returns: CreateProcess<'a>
|
|
Full Usage:
warnOnExitCode msg r
Parameters:
string
r : CreateProcess<'a>
Returns: CreateProcess<'a>
|
|
Full Usage:
withCommand command c
Parameters:
Command
-
The command to add to create process instance
c : CreateProcess<'a>
-
The create process instance
Returns: CreateProcess<'a>
|
|
Full Usage:
withEnvironment env c
Parameters:
(string * string) list
-
The environment variables list to add
c : CreateProcess<'a>
-
The create process instance
Returns: CreateProcess<'a>
|
|
Full Usage:
withEnvironmentMap env c
Parameters:
EnvMap
-
The environment variables map to add
c : CreateProcess<'a>
-
The create process instance
Returns: CreateProcess<'a>
|
|
Full Usage:
withOutputEvents onStdOut onStdErr c
Parameters:
string -> unit
-
Function to add as a standard output handler
onStdErr : string -> unit
-
Function to add as a standard error handler
c : CreateProcess<'a>
-
The create process instance
Returns: CreateProcess<'a>
|
|
Full Usage:
withOutputEventsNotNull onStdOut onStdErr c
Parameters:
string -> unit
-
Function to add as a standard output handler
onStdErr : string -> unit
-
Function to add as a standard error handler
c : CreateProcess<'a>
-
The create process instance
Returns: CreateProcess<'a>
|
|
Full Usage:
withStandardError stdErr c
Parameters:
StreamSpecification
c : CreateProcess<'a>
-
The create process instance
Returns: CreateProcess<'a>
|
|
Full Usage:
withStandardInput stdIn c
Parameters:
StreamSpecification
-
The standard input to use
c : CreateProcess<'a>
-
The create process instance
Returns: CreateProcess<'a>
|
|
Full Usage:
withStandardOutput stdOut c
Parameters:
StreamSpecification
-
The standard output to use
c : CreateProcess<'a>
-
The create process instance
Returns: CreateProcess<'a>
|
|
Full Usage:
withTimeout timeout c
Parameters:
TimeSpan
-
The timeout amount
c : CreateProcess<'a>
-
The create process instance
Returns: CreateProcess<'a>
|
|
Full Usage:
withWorkingDirectory workDir c
Parameters:
string
-
The working directory
c : CreateProcess<'a>
-
The create process instance
Returns: CreateProcess<'a>
|
|