Idris2Doc : System.File.Process

System.File.Process

Reexports

importpublic System.Escape
importpublic System.File.Error
importpublic System.File.Mode
importpublic System.File.Types

Definitions

fflush : HasIOio=>File->io ()
  Force a write of all user-space buffered data for the given `File`.

@ h the file handle to flush

Visibility: export
popen : HasIOio=>String->Mode->io (EitherFileErrorFile)
  Create a new unidirectional pipe by invoking the shell, which is passed the
given command-string using the '-c' flag, in a new process. The pipe is
opened with the given mode.

IMPORTANT: The NodeJS backend only currently supports the Read mode. Also with
the NodeJS backend, the opened process will finish execution before
popen returns (it blocks on open) which is different than other
backends which will block on close.

@ cmd the command to pass to the shell
@ m the mode the pipe should have

Visibility: export
pclose : HasIOio=>File->ioInt
  Wait for the process associated with the pipe to terminate.

@ fh the file handle to the stream to close/wait on

Visibility: export
recordSubProcess : Type
  Result of a popen2 command, containing the

Totality: total
Visibility: public export
Constructor: 
MkSubProcess : Int->AnyPtr->File->File->SubProcess

Projections:
.handler : SubProcess->AnyPtr
  The way to manipulate the spawned process, for systems where pid is not enough for this
.input : SubProcess->File
  The input stream of the spawned process
.output : SubProcess->File
  The output stream of the spawned process
.pid : SubProcess->Int
  Process id of the spawned process
.pid : SubProcess->Int
  Process id of the spawned process

Visibility: public export
pid : SubProcess->Int
  Process id of the spawned process

Visibility: public export
.handler : SubProcess->AnyPtr
  The way to manipulate the spawned process, for systems where pid is not enough for this

Visibility: public export
handler : SubProcess->AnyPtr
  The way to manipulate the spawned process, for systems where pid is not enough for this

Visibility: public export
.input : SubProcess->File
  The input stream of the spawned process

Visibility: public export
input : SubProcess->File
  The input stream of the spawned process

Visibility: public export
.output : SubProcess->File
  The output stream of the spawned process

Visibility: public export
output : SubProcess->File
  The output stream of the spawned process

Visibility: public export
popen2 : HasIOio=>String->io (EitherFileErrorSubProcess)
  Create a new bidirectional pipe by invoking the shell, which is passed the
given command-string using the '-c' flag, in a new process. On success
a SubProcess is returned which holds the process id and file handles
for input and output.
You should call `popen2Wait` after you've done with the child process
in order to clean up all system resources.

IMPORTANT: You may deadlock if write to a process which is waiting to flush
its output. It is recommended to read and write from separate threads.

This function is not supported on node at this time.

Visibility: export
popen2Wait : HasIOio=>SubProcess->ioInt
  Blocks and waits until the process created by `popen2` finished

This function relates to `popen2` like `pclose` relates to `popen`.
Returns exit code of the process being waited.
IMPORTANT: this function mustn't be called twice for the same argument.

Support of this function in the backends must be the same as for `popen2`.

Visibility: export
popen : HasIOio=>ListString->Mode->io (EitherFileErrorFile)
Visibility: export
popen2 : HasIOio=>ListString->io (EitherFileErrorSubProcess)
Visibility: export