File tree 1 file changed +35
-0
lines changed
1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,41 @@ pub fn main() anyerror!void {
24
24
debug .assert (result == sqlite .c .SQLITE_OK );
25
25
}
26
26
27
+ {
28
+ const Context = struct {
29
+ dir : std.fs.Dir ,
30
+ indent : usize ,
31
+ };
32
+
33
+ var stack = std .ArrayList (Context ).init (allocator );
34
+ try stack .append (.{
35
+ .dir = try std .fs .cwd ().openDir ("." , .{
36
+ .iterate = true ,
37
+ }),
38
+ .indent = 0 ,
39
+ });
40
+
41
+ while (stack .pop ()) | ctx | {
42
+ var iter = ctx .dir .iterate ();
43
+
44
+ while (try iter .next ()) | entry | {
45
+ const indent = try allocator .alloc (u8 , ctx .indent );
46
+ @memset (indent , ' ' );
47
+
48
+ std .debug .print ("{s}entry: {s}\n " , .{ indent , entry .name });
49
+ switch (entry .kind ) {
50
+ .directory = > try stack .append (.{
51
+ .dir = try ctx .dir .openDir (entry .name , .{
52
+ .iterate = true ,
53
+ }),
54
+ .indent = ctx .indent + 1 ,
55
+ }),
56
+ else = > {},
57
+ }
58
+ }
59
+ }
60
+ }
61
+
27
62
{
28
63
const extension_path = if (builtin .os .tag == .windows )
29
64
"./zig-out/bin/zigcrypto.dll"
You can’t perform that action at this time.
0 commit comments