Module Imandra_util.Util_io

Utils relying on IO

val str_of_file : string -> string

Read the content of a file

exception Write_to_file of string * exn
val write_to_file : string -> string -> unit

write_to_file file s writes s into file

raises Write_to_file

in case of failure

val print_pid : unit -> unit
type resolved_file = string

Resolved file (absolute path)

val find_file : file_name:string -> load_path:string list -> resolved_file option

Find a file.

We look in this order:

  • current directory,
  • load_path (left to right).

Finally, we return a resolved_file.

val string_of_loc : ?⁠clean:bool -> Location.t -> string option

Location strings. Returns None if it's a toplevel location

val with_signal : on_sig:(int -> unit) -> (unit -> 'a) -> 'a

Protection against signals when calling the given function