mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
commit
ef40581b44
1 changed files with 11 additions and 5 deletions
|
|
@ -229,7 +229,7 @@ module File : sig
|
||||||
in the directory [d] (or an empty stream if [d] is not a directory).
|
in the directory [d] (or an empty stream if [d] is not a directory).
|
||||||
@raise Sys_error in case of error (e.g. permission denied).
|
@raise Sys_error in case of error (e.g. permission denied).
|
||||||
@param recurse if true (default [false]), sub-directories are also
|
@param recurse if true (default [false]), sub-directories are also
|
||||||
explored. *)
|
explored, and the sequence only contains files. *)
|
||||||
|
|
||||||
val read_exn : t -> string
|
val read_exn : t -> string
|
||||||
(** Read the content of the given file, or raises some exception.
|
(** Read the content of the given file, or raises some exception.
|
||||||
|
|
@ -261,10 +261,16 @@ module File : sig
|
||||||
type walk_item = [ `File | `Dir ] * t
|
type walk_item = [ `File | `Dir ] * t
|
||||||
|
|
||||||
val walk : t -> walk_item gen
|
val walk : t -> walk_item gen
|
||||||
(** Like {!read_dir} (with [recurse=true]), this function walks
|
(** [walk p] generates the files and directories contained in a directory
|
||||||
a directory recursively and yields either files or directories.
|
tree by walking the tree. {!walk} treats anything for which {!is_directory}
|
||||||
Is a file anything that doesn't satisfy {!is_directory} (including
|
returns [false] (including symlinks, etc.) as a file.
|
||||||
symlinks, etc.)
|
|
||||||
|
The argument is treated as part of its own directory tree, so the
|
||||||
|
result of [walk p] always includes [p].
|
||||||
|
|
||||||
|
This is similar to {!read_dir} with [recurse=True], except that {!read_dir}
|
||||||
|
with [recurse=True] only generates file entries.
|
||||||
|
|
||||||
@raise Sys_error in case of error (e.g. permission denied) during iteration. *)
|
@raise Sys_error in case of error (e.g. permission denied) during iteration. *)
|
||||||
|
|
||||||
val walk_iter : t -> walk_item iter
|
val walk_iter : t -> walk_item iter
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue