OpamFilenameTyped filename manipulation
module Base : OpamStd.ABSTRACTBasenames
module Dir : OpamStd.ABSTRACTDirectory names
val cwd : unit -> Dir.tReturn the current working directory
val rmdir : Dir.t -> unitRemove a directory
val cleandir : Dir.t -> unitClean the contents of a directory.
val mkdir : Dir.t -> unitCreate a directory
val dir_is_empty : Dir.t -> boolval in_dir : Dir.t -> (unit -> 'a) -> 'aEvaluate a function in a given directory
Turns an assoc list into an array suitable to be provided as environment
val exec :
Dir.t ->
?env:(string * string) list ->
?name:string ->
?metadata:(string * string) list ->
?keep_going:bool ->
string list list ->
unitExecute a list of commands in a given directory
val exists_dir : Dir.t -> boolDoes the directory existsb ?
val raw_dir : string -> Dir.tCreation from a raw string (as http://<path>)
val with_tmp_dir : (Dir.t -> 'a) -> 'aExecute a function in a temp directory
val with_tmp_dir_job : (Dir.t -> 'a OpamProcess.job) -> 'a OpamProcess.jobProvide an automatically cleaned up temp directory to a job
include OpamStd.ABSTRACTval of_string : string -> tval to_string : t -> stringval to_json : t -> OpamJson.tmodule Set : OpamStd.SET with type elt = tmodule Map : OpamStd.MAP with type key = tCreate a file from a basename and the current working directory as dirname
val raw : string -> tCreation from a raw string (as http://<path>)
val prettify : t -> stringPrettify a filename:
val prettify_dir : Dir.t -> stringPrettify a dirname.
val read : t -> stringRetrieves the contents from the hard disk.
val open_in : t -> in_channelOpen a channel from a given file.
val open_out : t -> out_channelval remove : t -> unitRemoves everything in filename if existed.
val write : t -> string -> unitRemoves everything in filename if existed, then write contents instead.
val exists : t -> boolReturns true if the file exists and is a regular file or a symlink to one
val check_suffix : t -> string -> boolCheck whether a file has a given suffix
val with_contents : (string -> 'a) -> t -> 'aApply a function on the contents of a file
Copy a file in a directory. If root is set, copy also the sub-directories. For instance, copy_in ~root:"/foo" "/foo/bar/gni" "/toto" creates "/toto/bar/gni".
val is_symlink : t -> boolIs a symlink ?
val is_exec : t -> boolIs an executable ?
Installs a file to a destination. Optionnally set if the destination should be set executable
Symlink a file. If symlink is not possible on the system, use copy instead.
Extract an archive in a given directory (it rewrites the root to match Dir.t dir if needed)
Extract an archive in a given directory (which should already exists)
val extract_generic_file : generic_file -> Dir.t -> unitExtract a generic file
val ends_with : string -> t -> boolCheck whether a filename ends with a given suffix
val digest : t -> stringCompute the MD5 digest of a file
val checksum : t -> string listCompute the MD5 digest a file. Return the empty list if the file does not exist.
val checksum_dir : Dir.t -> string listCompute the MD5 digest for all files in a directory.
val touch : t -> unitCreate an empty file
val chmod : t -> int -> unitChange file permissions
val with_flock : ?read:bool -> t -> ('a -> 'b) -> 'a -> 'bFile locks
copy_if_check t src dst copies all the files from one directory to another. Do nothing if OPAMDONOTCOPYFILE is set to a non-empty value.
module Op : sig ... endmodule Attribute : sig ... endSimple structure to hanle file attributes
val to_attribute : Dir.t -> t -> Attribute.tConvert a filename to an attribute, relatively to a root