awesome-ocap icon indicating copy to clipboard operation
awesome-ocap copied to clipboard

Emily file API - pattern?

Open dckc opened this issue 3 years ago • 0 comments

https://github.com/Agoric/agoric-sdk/pull/4987#discussion_r841111422

A separate lookupAdmin method? hm. This structure reminds me of the Emily file API (which I have ported to python umpteen times, none of which is handy just now).

Ah... actually, it had subEdFiles and subRdFiles just like we have lookup and lookupAdmin here. Fair enough.

type readable = {
isDir : unit -> bool;
exists : unit -> bool;
subRdFiles : unit -> readable list;
subRdFile : string -> readable;
inChannel : unit -> in_channel;
getBytes : unit -> string;
fullPath : unit -> string;
}
type editable = {
ro : readable;
subEdFiles : unit -> editable list;
subEdFile : string -> editable;
outChannel : unit -> out_channel;
setBytes : string -> unit;
mkDir : unit -> unit;
createNewFile : unit -> unit;
delete : unit -> unit;
}

dckc avatar Apr 06 '22 15:04 dckc