fflush : HasIO io => File -> io ()
Force a write of all user-space buffered data for the given `File`.
@ h the file handle to flush
Visibility: exportpopen : HasIO io => String -> Mode -> io (Either FileError File)
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: exportpclose : HasIO io => File -> io Int
Wait for the process associated with the pipe to terminate.
@ fh the file handle to the stream to close/wait on
Visibility: exportrecord SubProcess : 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 exportpid : 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 exporthandler : 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 exportinput : SubProcess -> File
The input stream of the spawned process
Visibility: public export.output : SubProcess -> File
The output stream of the spawned process
Visibility: public exportoutput : SubProcess -> File
The output stream of the spawned process
Visibility: public exportpopen2 : HasIO io => String -> io (Either FileError SubProcess)
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: exportpopen2Wait : HasIO io => SubProcess -> io Int
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: exportpopen : HasIO io => List String -> Mode -> io (Either FileError File)
- Visibility: export
popen2 : HasIO io => List String -> io (Either FileError SubProcess)
- Visibility: export