4 type key
= [ `I
of int | `S
of string ]
9 val create
: string -> t
11 val get
: t
-> key
-> string option
12 val add
: t
-> key
-> string -> unit
16 module Fs
: T
= struct
19 let create path
= (try Unix.mkdir path
0o777
with Unix.Unix_error
(Unix.EEXIST
,_
,_
) -> () | e
-> raise e
); path
22 | `I n
-> string_of_int n
23 | `S s
-> Digest.to_hex
(Digest.string s
)
24 let get path name
= try Std.input_file
(Filename.concat path
(make name
)) >> some
with _
-> None
25 let add path name
value = Std.output_file
(Filename.concat path
(make name
)) value