Module Private.File
File IO.
val cut_ext : fpath -> string * stringcut_ext fis(fst, snd)the pair that results from cutting the basename offat the rightmost'.'(not included in the result) before the firstFilename.dir_sep. If there is no such character, fst isfandsndis"".
val catch_sys_error : (unit -> ('a, string) Stdlib.result) -> ('a, string) Stdlib.resultcatch_sys_error finvokesf ()and catches anySys_errorthat may be raised and returns its messageeasError e.
val with_open_in : string -> (Stdlib.in_channel -> 'a) -> ('a, string) Stdlib.resultwith_open_in file fopen a channel onfileand gives it tof. Ensures the channel is closed when the function returns and reports anySys_errororEnd_of_fileas anError.
val with_open_out : string -> (Stdlib.out_channel -> 'a) -> ('a, string) Stdlib.resultwith_open_out file fopen a channel onfileand gives it tof. Ensures the channel is closed when the function returns and reports anySys_errororEnd_of_fileas anError.
val to_string : fpath -> (string, string) Stdlib.resultto_string filereads filefileto a string.
val of_string : fpath -> string -> (unit, string) Stdlib.resultof_string file swrites filefilewiths.
val exists : fpath -> (bool, string) Stdlib.resultexists fileistrueifffileexists and is not a directory.
val delete : fpath -> (bool, string) Stdlib.resultdelete filedeletes filefile. The boolean indicates whether the file actually existed.