mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-06 03:05:30 -05:00
remove use of 5.1 only function
This commit is contained in:
parent
8e6340846a
commit
ba1876f957
1 changed files with 8 additions and 12 deletions
|
|
@ -31,18 +31,6 @@ let main ~port ~runner ~ext ~dir ~n_conn () : unit Lwt.t =
|
||||||
()
|
()
|
||||||
else if Str_tbl.mem seen file then
|
else if Str_tbl.mem seen file then
|
||||||
()
|
()
|
||||||
else if Sys.is_regular_file file then
|
|
||||||
if ext <> "" && Filename.extension file <> ext then
|
|
||||||
()
|
|
||||||
else (
|
|
||||||
Str_tbl.add seen file ();
|
|
||||||
M_lwt.run_in_lwt_and_await (fun () -> Lwt_io.write_line oc file);
|
|
||||||
let res =
|
|
||||||
M_lwt.run_in_lwt_and_await (fun () -> Lwt_io.read_line ic)
|
|
||||||
in
|
|
||||||
let@ () = M.Lock.with_ lock_stdout in
|
|
||||||
Printf.printf "%s\n%!" res
|
|
||||||
)
|
|
||||||
else if Sys.is_directory file then (
|
else if Sys.is_directory file then (
|
||||||
let _sp =
|
let _sp =
|
||||||
Trace.enter_manual_sub_span ~parent:_sp ~__FILE__ ~__LINE__ "walk-dir"
|
Trace.enter_manual_sub_span ~parent:_sp ~__FILE__ ~__LINE__ "walk-dir"
|
||||||
|
|
@ -53,6 +41,14 @@ let main ~port ~runner ~ext ~dir ~n_conn () : unit Lwt.t =
|
||||||
let d = Sys.readdir file in
|
let d = Sys.readdir file in
|
||||||
Array.sort String.compare d;
|
Array.sort String.compare d;
|
||||||
Array.iter (fun sub -> walk (Filename.concat file sub)) d
|
Array.iter (fun sub -> walk (Filename.concat file sub)) d
|
||||||
|
) else if ext <> "" && Filename.extension file <> ext then
|
||||||
|
()
|
||||||
|
else (
|
||||||
|
Str_tbl.add seen file ();
|
||||||
|
M_lwt.run_in_lwt_and_await (fun () -> Lwt_io.write_line oc file);
|
||||||
|
let res = M_lwt.run_in_lwt_and_await (fun () -> Lwt_io.read_line ic) in
|
||||||
|
let@ () = M.Lock.with_ lock_stdout in
|
||||||
|
Printf.printf "%s\n%!" res
|
||||||
)
|
)
|
||||||
in
|
in
|
||||||
walk dir;
|
walk dir;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue