1. camlspotter
  2. spotlib

Commits

camlspotter  committed 850949e

Sys.command is extended with fmt

  • Participants
  • Parent commits 09cd0dd
  • Branches default

Comments (0)

Files changed (2)

File lib/xsys.ml

View file
 ;;
 
 let checkenv s = try ignore (Sys.getenv s); true with Not_found -> false
+
+let command fmt = Printf.kprintf (fun s -> Sys.command s) fmt
+let must_do fmt = Printf.kprintf (fun s -> assert (Sys.command s = 0)) fmt
+let cp = must_do "/bin/cp %s %s"
+let patch_p1 = must_do "/bin/patch -p1 < %s"

File lib/xsys.mli

View file
       
 val checkenv : string -> bool
   (** check existence of environment variable *)
+
+val command : (int, unit, string, unit) format4 -> int
+val must_do : (unit, unit, string, unit) format4 -> unit
+val cp : string -> string -> unit
+val patch_p1 : string -> unit