awesome-ocap
awesome-ocap copied to clipboard
Emily file API - pattern?
https://github.com/Agoric/agoric-sdk/pull/4987#discussion_r841111422
A separate
lookupAdminmethod? 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
subEdFilesandsubRdFilesjust like we havelookupandlookupAdminhere. 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;
}