On a quest for agency in Bellairs

add skeleton schema

+18
mvp/bellairs.mli
···
+
+
type dir
+
type file
+
+
type entry = {
+
name: string;
+
file: file;
+
}
+
+
val root : dir
+
val list : dir -> entry list
+
+
val create : dir -> string -> file
+
val open_ : dir -> string -> file
+
val delete : dir -> string -> unit
+
+
val size : file -> int64
+
val read : file -> ?off:int64 -> ?len:int64 -> string
+34
mvp/bellairs.schema
···
+
@0xa59e1c95e37fb55d;
+
+
interface Directory {
+
# Represents a directory in the filesystem
+
+
list @0 () -> (entries :List(Entry));
+
# Lists all entries in the directory
+
+
struct Entry {
+
name @0 :Text; # Name of the entry
+
file @1 :File; # Reference to the file object
+
}
+
+
create @1 (name :Text) -> (file :File);
+
# Creates a new file with the given name
+
+
open @2 (name :Text) -> (file :File);
+
# Opens an existing file with the given name
+
+
delete @3 (name :Text);
+
# Deletes a file with the given name
+
}
+
+
interface File {
+
# Represents a file in the filesystem
+
+
size @0 () -> (size :UInt64);
+
# Returns the size of the file in bytes
+
+
read @1 (off :UInt64 = 0, len :UInt64 = 0xffffffffffffffff) -> (data :Data);
+
# Reads data from the file, optionally starting at offset and reading up to len bytes
+
# Default is to read the entire file
+
}
+
+4
mvp/dune
···
+
(library
+
(name bellairs)
+
(modules_without_implementation bellairs)
+
(modules bellairs))
+1
mvp/dune-project
···
+
(lang dune 3.17)