diff options
Diffstat (limited to 'src/fs.zig')
| -rw-r--r-- | src/fs.zig | 36 |
1 files changed, 0 insertions, 36 deletions
@@ -1104,42 +1104,6 @@ pub const platform_has_fs = !pardes.isolated and switch (pardes.platform) { const find_max_hits = 512; -/// What a Find or Grep walk passed over, said under its hits: directories -/// it might not open, and caps it stopped at. -pub const WalkNotes = struct { - skipped: usize = 0, - hits_cut: bool = false, - /// A pane search's matching lines it stopped at, its rows filling - /// look.search_text_output_bytes; 0 if none. - rows_cut: usize = 0, - /// The cap on entries walked it stopped at, 0 if none. - walk_cut: usize = 0, - - pub const max_hits = find_max_hits; - pub const max_files = grep_max_files; - pub const max_depth = find_max_depth; - - /// The lines that say it, each ending in a newline, into `out`. - pub fn write(n: WalkNotes, out: []u8) usize { - var w = std.Io.Writer.fixed(out); - if (n.hits_cut) w.print("cut at {d} hits\n", .{max_hits}) catch {}; - if (n.rows_cut > 0) w.print("cut at {d} lines\n", .{n.rows_cut}) catch {}; - if (n.walk_cut > 0) w.print("walk cut at {d} entries\n", .{n.walk_cut}) catch {}; - if (n.skipped > 0) w.print("{d} director{s} skipped: permission denied\n", .{ n.skipped, if (n.skipped == 1) "y" else "ies" }) catch {}; - return w.buffered().len; - } - - /// Whether `line` is one of those, not a hit. - pub fn isNote(line: []const u8) bool { - if (std.mem.startsWith(u8, line, "cut at ") or std.mem.startsWith(u8, line, "walk cut at ")) return true; - const digits = for (line, 0..) |c, i| { - if (!std.ascii.isDigit(c)) break i; - } else line.len; - if (digits == 0) return false; - const rest = line[digits..]; - return std.mem.startsWith(u8, rest, " director") or std.mem.startsWith(u8, rest, " file"); - } -}; const find_max_depth = 16; pub const find_skip = [_][]const u8{ |
