let perm = 0o640;; let string_of_file file = let fd = openfile file [ O_RDONLY ] 0 in try_finalize string_from_descr fd close fd ;; let file_of_string str file = let fd = openfile file [ O_WRONLY; O_CREAT; O_TRUNC ] perm in try_finalize (descr_from_string str) fd close fd ;; |