From e34fd08b119823b74be838cb21eaf81b72b659d1 Mon Sep 17 00:00:00 2001 From: hyperion Date: Sat, 14 Nov 2026 10:42:40 +0100 Subject: [PATCH] small bugfix adding missing link_count field --- main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.cpp b/main.cpp index 924d948..24348b2 100644 --- a/main.cpp +++ b/main.cpp @@ -19,6 +19,7 @@ struct TreeNode { std::filesystem::file_type type; int inode; + int link_count; std::string name; int parent; int mode; @@ -59,6 +60,7 @@ TreeNode parse(const std::filesystem::path& p, int& next_inode, int& parent_inod node.atime = static_cast(buf.st_atime); node.ctime = static_cast(buf.st_ctime); node.size = static_cast(buf.st_size); + node.link_count = static_cast(buf.st_nlink); } if(node.type == std::filesystem::file_type::directory) { @@ -249,6 +251,7 @@ JsonValue to_json(const TreeNode& node) { obj["type"] = file_type_to_string(node.type); obj["inode"] = node.inode; + obj["link_count"] = node.link_count; obj["name"] = node.name; obj["parent"] = node.parent; obj["mode"] = node.mode;