FAKE - F# Make - A DSL for build tasks and more FAKE
6.0.0

Lookig for older versions of the documentation, pre FAKE v6? See 

v5.fake.build

Proc Module

Module to start or run processes, used in combination with the CreateProcess API.

Example


 #r "paket:
     nuget Fake.Core.Process //"
     open Fake.Core
     CreateProcess.fromRawCommand "./folder/mytool.exe" ["arg1"; "arg2"]
     |> Proc.run
     |> ignore

Functions and values

Function or value Description

Proc.run c

Full Usage: Proc.run c

Parameters:
Returns: 'a

Like start but waits for the result synchronously.

c : CreateProcess<'a>

The create process instance

Returns: 'a

Proc.start c

Full Usage: Proc.start c

Parameters:
Returns: Task<'a>

Starts the given process and waits for the Result task. (see startRaw documentation). In most common scenarios the Result includes the Raw task or the exit-code one way or another.

c : CreateProcess<'a>

The create process instance

Returns: Task<'a>

Proc.startAndAwait c

Full Usage: Proc.startAndAwait c

Parameters:
Returns: Async<'a>

Convenience method when you immediately want to await the result of start, just note that when used incorrectly this might lead to race conditions (ie if you use StartAsTask and access reference cells in CreateProcess after that returns)

c : CreateProcess<'a>

The create process instance

Returns: Async<'a>

Proc.startRaw c

Full Usage: Proc.startRaw c

Parameters:
Returns: Task<AsyncProcessResult<'a>>

Starts a process. The process has been started successfully after the returned task has been completed.

After the task has been completed you retrieve two other tasks:

  • One Raw - Task to indicate when the process exited (and return the exit-code for example)
  • One Result - Task for the final result object.

Note: The Result task might finish while the Raw task is still running, this enables you to work with the result object before the process has exited. For example consider a long running process where you are only interested in the first couple of output lines

c : CreateProcess<'a>

The create process instance

Returns: Task<AsyncProcessResult<'a>>

Proc.startRawSync c

Full Usage: Proc.startRawSync c

Parameters:
Returns: AsyncProcessResult<'a>

Similar to startRaw but waits until the process has been started.

c : CreateProcess<'a>

The create process instance

Returns: AsyncProcessResult<'a>