1 2 3 4 5 6 7 8 9 10 11 12
const std = @import("std"); pub fn ls() !void { const dir = try std.fs.cwd().openDir(".", .{ .iterate = true }); var iterator = dir.iterate(); while (try iterator.next()) |entry| { const name = entry.name; std.debug.print("{s}\n", .{name}); } }