A simple but flexible library for shelling out from Clojure.
A simple but flexible library for shelling out from Clojure.
(done proc)
Close the process's output stream (sending EOF).
Close the process's output stream (sending EOF).
(exit-code process)
(exit-code process timeout)
Waits for the process to terminate (blocking the thread) and returns the exit code. If timeout is passed, it is assumed to be milliseconds to wait for the process to exit. If it does not exit in time, it is killed (with or without fire).
Waits for the process to terminate (blocking the thread) and returns the exit code. If timeout is passed, it is assumed to be milliseconds to wait for the process to exit. If it does not exit in time, it is killed (with or without fire).
(feed-from process from & {flush? :flush :or {flush? true} :as all})
Feed to a process's input stream with optional. Options passed are fed to clojure.java.io/copy. They are :encoding to set the encoding and :buffer-size to set the size of the buffer. :encoding defaults to UTF-8 and :buffer-size to 1024. If :flush is specified and is false, the process will be flushed after writing.
Feed to a process's input stream with optional. Options passed are fed to clojure.java.io/copy. They are :encoding to set the encoding and :buffer-size to set the size of the buffer. :encoding defaults to UTF-8 and :buffer-size to 1024. If :flush is specified and is false, the process will be flushed after writing.
(feed-from-string process s & args)
Feed the process some data from a string.
Feed the process some data from a string.
(flush process)
Flush the output stream of a process.
Flush the output stream of a process.
(proc & args)
Spin off another process. Returns the process's input stream, output stream, and err stream as a map of :in, :out, and :err keys If passed the optional :dir and/or :env keyword options, the dir and enviroment will be set to what you specify. If you pass :verbose and it is true, commands will be printed. If it is set to :very, environment variables passed, dir, and the command will be printed. If passed the :clear-env keyword option, then the process will not inherit its environment from its parent process.
Spin off another process. Returns the process's input stream, output stream, and err stream as a map of :in, :out, and :err keys If passed the optional :dir and/or :env keyword options, the dir and enviroment will be set to what you specify. If you pass :verbose and it is true, commands will be printed. If it is set to :very, environment variables passed, dir, and the command will be printed. If passed the :clear-env keyword option, then the process will not inherit its environment from its parent process.
(read-line process from)
Read a line from a process' :out or :err.
Read a line from a process' :out or :err.
(stream-to process from to & args)
Stream :out or :err from a process to an ouput stream. Options passed are fed to clojure.java.io/copy. They are :encoding to set the encoding and :buffer-size to set the size of the buffer. :encoding defaults to UTF-8 and :buffer-size to 1024.
Stream :out or :err from a process to an ouput stream. Options passed are fed to clojure.java.io/copy. They are :encoding to set the encoding and :buffer-size to set the size of the buffer. :encoding defaults to UTF-8 and :buffer-size to 1024.
(stream-to-out process from & args)
Streams the output of the process to System/out
Streams the output of the process to System/out
(stream-to-string process from & args)
Streams the output of the process to a string and returns it.
Streams the output of the process to a string and returns it.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close