package febusy

  1. Overview
  2. Docs

Useful functions to deal with the operating system.

val home : unit -> string

The value of "$HOME".

val cmdf : ?in_dir:string -> ?silent:bool -> ('a, unit, string, unit) format4 -> 'a

Run a shell command (wrapper around Sys.command which throws an exception when the return value is non-zero).

val cmd_to_string_list : string -> string list

Run a shell command and get the output as a list of strings.

val feed_cmd : string -> string -> unit

Feed a string as stdin of a shell command.

val write_lines : string -> string list -> unit

Write lines into a given file path.

val read_lines : string -> string list

Read a file as a list of strings.

OCaml

Innovation. Community. Security.