add CCIO.File.walk_l

This commit is contained in:
Simon Cruanes 2017-02-17 15:09:51 +01:00
parent 801f059532
commit 6fadeb414e
2 changed files with 13 additions and 0 deletions

View file

@ -320,6 +320,14 @@ module File = struct
)
*)
let walk_l d =
let l = ref [] in
let g = walk d in
let rec aux () = match g() with
| None -> !l
| Some x -> l := x :: !l; aux ()
in aux ()
type walk_item = [`File | `Dir] * t
let read_dir ?(recurse=false) d =

View file

@ -202,6 +202,11 @@ module File : sig
symlinks, etc.)
@raise Sys_error in case of error (e.g. permission denied) during iteration *)
val walk_l : t -> walk_item list
(** Same as {!walk} but returns a list (therefore it's eager and might
take some time on large directories)
@since NEXT_RELEASE *)
val show_walk_item : walk_item -> string
val with_temp :