Up

module FS

: sig

Store Git objects on the local filesystem.

#
module type S = sig
include Store.S
#
val create_file : string -> Tree.perm -> Blob.t -> unit Lwt.t

Create a file on the filesystem, with the given mode.

#
val entry_of_file : ?root:string -> string -> Tree.perm -> Blob.t -> Cache.entry option Lwt.t

Generate a cache entry for the file. Create a fresh file if it does not already exist. If root is not set, use the current working directory as repository root.

end

Constructor

#
module type IO = sig
#
val getcwd : unit -> string Lwt.t

Get the current working directory.

#
val realpath : string -> string Lwt.t

Very dumb real-path. Only works for existing directories.

#
val mkdir : string -> unit Lwt.t

Create a directory (and the parent dirs if needed).

#
val remove : string -> unit Lwt.t

Remote a file or a directory (even if non-empty).

#
val file_exists : string -> bool Lwt.t

Does the given file exists ?

#
val directories : string -> string list Lwt.t

List the subdirs.

#
val files : string -> string list Lwt.t

List the subfiles.

#
val rec_files : string -> string list Lwt.t

rec_files dir is the list of the files recursively present in dir and all of its sub-directories. Return filenames prefixed by dir.

#
val read_file : string -> Cstruct.t Lwt.t

mmap a file and return a mutable C-like structure with its contents.

#
val write_file : string -> Cstruct.t -> unit Lwt.t

Write a bigarray to a file.

#
val chmod : string -> int -> unit Lwt.t

Change the file mode.

#
val stat_info : string -> Cache.stat_info

Return the stats of the given file.

end
#
module Make : functor (IO : IO) -> S

Create an on-disk store implementation.

end