`sig
exception FileDoesntExist of FilePath.filename
exception RecursiveLink of FilePath.filename
type 'a error_handler = string -> 'a -> unit
exception Fatal of string
type action_link =
Follow
| Skip
| SkipInform of (FilePath.filename -> unit)
| AskFollow of (FilePath.filename -> bool)
type interactive = Force | Ask of (FilePath.filename -> bool)
type base_permission = {
sticky : bool;
exec : bool;
write : bool;
read : bool;
}
type permission = {
user : FileUtil.base_permission;
group : FileUtil.base_permission;
other : FileUtil.base_permission;
}
val permission_of_int : int -> FileUtil.permission
val int_of_permission : FileUtil.permission -> int
module Mode :
sig
type who = [ `All | `Group | `Other | `User ]
type wholist =
[ `All | `Group | `List of FileUtil.Mode.who list | `Other | `User
]
type permcopy = [ `Group | `Other | `User ]
type perm = [ `Exec | `ExecX | `Read | `Sticky | `StickyO | `Write ]
type permlist =
[ `Exec
| `ExecX
| `List of FileUtil.Mode.perm list
| `Read
| `Sticky
| `StickyO
| `Write ]
type actionarg =
[ `Exec
| `ExecX
| `Group
| `List of FileUtil.Mode.perm list
| `Other
| `Read
| `Sticky
| `StickyO
| `User
| `Write ]
type action =
[ `Add of FileUtil.Mode.actionarg
| `Remove of FileUtil.Mode.actionarg
| `Set of FileUtil.Mode.actionarg ]
type actionlist =
[ `Add of FileUtil.Mode.actionarg
| `List of FileUtil.Mode.action list
| `Remove of FileUtil.Mode.actionarg
| `Set of FileUtil.Mode.actionarg ]
type clause =
[ `All of FileUtil.Mode.actionlist
| `Group of FileUtil.Mode.actionlist
| `None of FileUtil.Mode.actionlist
| `Other of FileUtil.Mode.actionlist
| `User of FileUtil.Mode.actionlist ]
type t = FileUtil.Mode.clause list
val to_string : FileUtil.Mode.t -> string
val apply :
is_dir:bool ->
umask:int -> Unix.file_perm -> FileUtil.Mode.t -> Unix.file_perm
end
type size =
TB of int64
| GB of int64
| MB of int64
| KB of int64
| B of int64
val byte_of_size : FileUtil.size -> int64
val size_add : FileUtil.size -> FileUtil.size -> FileUtil.size
val size_compare : ?fuzzy:bool -> FileUtil.size -> FileUtil.size -> int
val string_of_size : ?fuzzy:bool -> FileUtil.size -> string
type kind = Dir | File | Dev_char | Dev_block | Fifo | Socket | Symlink
type stat = {
kind : FileUtil.kind;
is_link : bool;
permission : FileUtil.permission;
size : FileUtil.size;
owner : int;
group_owner : int;
access_time : float;
modification_time : float;
creation_time : float;
device : int;
inode : int;
}
val stat : ?dereference:bool -> FilePath.filename -> FileUtil.stat
exception UmaskError of string
type umask_error = [ `Exc of exn | `NoStickyBit of int ]
val umask :
?error:FileUtil.umask_error FileUtil.error_handler ->
?mode:[< `Octal of int | `Symbolic of FileUtil.Mode.t ] ->
[< `Octal of int -> 'a | `Symbolic of FileUtil.Mode.t -> 'a ] -> 'a
val umask_apply : int -> int
type test_file =
Is_dev_block
| Is_dev_char
| Is_dir
| Exists
| Is_file
| Is_set_group_ID
| Has_sticky_bit
| Is_link
| Is_pipe
| Is_readable
| Is_writeable
| Size_not_null
| Size_bigger_than of FileUtil.size
| Size_smaller_than of FileUtil.size
| Size_equal_to of FileUtil.size
| Size_fuzzy_equal_to of FileUtil.size
| Is_socket
| Has_set_user_ID
| Is_exec
| Is_owned_by_user_ID
| Is_owned_by_group_ID
| Is_newer_than of FilePath.filename
| Is_older_than of FilePath.filename
| Is_newer_than_date of float
| Is_older_than_date of float
| And of FileUtil.test_file * FileUtil.test_file
| Or of FileUtil.test_file * FileUtil.test_file
| Not of FileUtil.test_file
| Match of string
| True
| False
| Has_extension of FilePath.extension
| Has_no_extension
| Is_parent_dir
| Is_current_dir
| Basename_is of FilePath.filename
| Dirname_is of FilePath.filename
| Custom of (FilePath.filename -> bool)
val test :
?match_compile:(FilePath.filename -> FilePath.filename -> bool) ->
FileUtil.test_file -> FilePath.filename -> bool
exception ChmodError of string
type chmod_error = [ `Exc of exn ]
val chmod :
?error:FileUtil.chmod_error FileUtil.error_handler ->
?recurse:bool ->
[< `Octal of Unix.file_perm | `Symbolic of FileUtil.Mode.t ] ->
FilePath.filename list -> unit
exception MkdirError of string
type mkdir_error =
[ `DirnameAlreadyUsed of FilePath.filename
| `Exc of exn
| `MissingComponentPath of FilePath.filename
| `MkdirChmod of
FilePath.filename * Unix.file_perm * string * FileUtil.chmod_error
]
val mkdir :
?error:FileUtil.mkdir_error FileUtil.error_handler ->
?parent:bool ->
?mode:[< `Octal of Unix.file_perm | `Symbolic of FileUtil.Mode.t ] ->
FilePath.filename -> unit
exception RmError of string
type rm_error =
[ `DirNotEmpty of FilePath.filename
| `Exc of exn
| `NoRecurse of FilePath.filename ]
val rm :
?error:FileUtil.rm_error FileUtil.error_handler ->
?force:FileUtil.interactive ->
?recurse:bool -> FilePath.filename list -> unit
exception CpError of string
type cp_error =
[ `CannotChmodDstDir of FilePath.filename * exn
| `CannotCopyDir of FilePath.filename
| `CannotCopyFilesToFile of FilePath.filename list * FilePath.filename
| `CannotCreateDir of FilePath.filename * exn
| `CannotListSrcDir of FilePath.filename * exn
| `CannotOpenDstFile of FilePath.filename * exn
| `CannotOpenSrcFile of FilePath.filename * exn
| `CannotRemoveDstFile of FilePath.filename * exn
| `DstDirNotDir of FilePath.filename
| `ErrorRead of FilePath.filename * exn
| `ErrorWrite of FilePath.filename * exn
| `Exc of exn
| `NoSourceFile of FilePath.filename
| `PartialWrite of FilePath.filename * int * int
| `SameFile of FilePath.filename * FilePath.filename
| `UnhandledType of FilePath.filename * FileUtil.kind ]
val cp :
?follow:FileUtil.action_link ->
?force:FileUtil.interactive ->
?recurse:bool ->
?preserve:bool ->
?error:FileUtil.cp_error FileUtil.error_handler ->
FilePath.filename list -> FilePath.filename -> unit
exception MvError of string
type mv_error =
[ `Exc of exn
| `MvCp of
FilePath.filename * FilePath.filename * string * FileUtil.cp_error
| `MvRm of FilePath.filename * string * FileUtil.rm_error
| `NoSourceFile ]
val mv :
?error:FileUtil.mv_error FileUtil.error_handler ->
?force:FileUtil.interactive ->
FilePath.filename -> FilePath.filename -> unit
type touch_time_t =
Touch_now
| Touch_file_time of FilePath.filename
| Touch_timestamp of float
val touch :
?atime:bool ->
?mtime:bool ->
?create:bool -> ?time:FileUtil.touch_time_t -> FilePath.filename -> unit
val filter :
FileUtil.test_file -> FilePath.filename list -> FilePath.filename list
val ls : FilePath.filename -> FilePath.filename list
val pwd : unit -> FilePath.filename
val readlink : FilePath.filename -> FilePath.filename
val which :
?path:FilePath.filename list -> FilePath.filename -> FilePath.filename
val cmp :
?skip1:int ->
FilePath.filename -> ?skip2:int -> FilePath.filename -> int option
val du :
FilePath.filename list ->
FileUtil.size * (FilePath.filename * FileUtil.size) list
val find :
?follow:FileUtil.action_link ->
?match_compile:(FilePath.filename -> FilePath.filename -> bool) ->
FileUtil.test_file ->
FilePath.filename -> ('a -> FilePath.filename -> 'a) -> 'a -> 'a
end`