We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d834d73 commit 7d71840Copy full SHA for 7d71840
examples/fs/dune
@@ -0,0 +1,3 @@
1
+(executable
2
+ (name main)
3
+ (libraries eio_main))
examples/fs/main.ml
@@ -0,0 +1,21 @@
+(* Walks the directory tree rooted at the current directory,
+ displaying all directory names (skipping hidden directories and `_build`). *)
+
4
+open Eio.Std
5
6
+let ( / ) = Eio.Path.( / )
7
8
+let rec scan t =
9
+ match Eio.Path.kind ~follow:false t with
10
+ | `Directory ->
11
+ traceln "Visiting %a" Eio.Path.pp t;
12
+ Eio.Path.read_dir t |> List.iter (function
13
+ | "_build" -> ()
14
+ | item when String.starts_with ~prefix:"." item -> ()
15
+ | item -> scan (t / item)
16
+ )
17
+ | _ -> ()
18
19
+let () =
20
+ Eio_main.run @@ fun env ->
21
+ scan (Eio.Stdenv.cwd env)
0 commit comments