Use duck for util-io.
This commit is contained in:
parent
375c4ed857
commit
201093ab8c
5 changed files with 102 additions and 48 deletions
|
@ -124,3 +124,62 @@ Returns a dictionary with the following keys:
|
|||
Returns annotated source with information about originating commits
|
||||
for each line.
|
||||
|
||||
|
||||
## util-io [module]
|
||||
|
||||
(import util-io)
|
||||
|
||||
Module implementing advanced I/O.
|
||||
|
||||
### read-lines/no-bom [procedure]
|
||||
|
||||
(read-lines/no-bom ip)
|
||||
|
||||
|
||||
* ```port``` - an input port
|
||||
|
||||
Reads lines using ```read-lines``` and if the first line contains
|
||||
UTF-8 BOM, removes it.
|
||||
|
||||
|
||||
### get-process-output-lines [procedure]
|
||||
|
||||
(get-process-output-lines cmd
|
||||
. args)
|
||||
|
||||
|
||||
* ```cmd``` - a string with the command
|
||||
* ```args``` - list of arguments to pass to process
|
||||
|
||||
Returns a list of strings representing all the lines produced by
|
||||
running the command given.
|
||||
|
||||
|
||||
### get-process-exit+output-lines [procedure]
|
||||
|
||||
(get-process-exit+output-lines cmd
|
||||
. args)
|
||||
|
||||
|
||||
* ```cmd``` - a string with the command
|
||||
* ```args``` - list of arguments to pass to process
|
||||
|
||||
Returns two values - an exit code and a list of strings representing
|
||||
all the lines produced by running the command given.
|
||||
|
||||
|
||||
### process-send/recv [procedure]
|
||||
|
||||
(process-send/recv cmd
|
||||
args
|
||||
. lines)
|
||||
|
||||
|
||||
* ```cmd``` - a string with command
|
||||
* ```args``` - list of arguments
|
||||
* ```lines``` - lines to feed to stdin of the process
|
||||
|
||||
Executes given command ```cmd``` with given argument list ```args```
|
||||
writing all ```lines``` to its standard input and then reads all the
|
||||
process output.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue