From 2a023c9ad5488a1a0545adf1308f83043b1389db Mon Sep 17 00:00:00 2001
From: Edward Rudd <urkle@outoforder.cc>
Date: Tue, 14 Oct 2014 14:47:37 +0000
Subject: [PATCH] output file size in dir listing
---
client/test/main.cpp | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/client/test/main.cpp b/client/test/main.cpp
index 6c4411e..c76a9ed 100644
--- a/client/test/main.cpp
+++ b/client/test/main.cpp
@@ -5,6 +5,7 @@
#include "humble_api.h"
#include <dirent.h>
+#include <sys/stat.h>
extern "C" {
void test_list_files();
@@ -28,7 +29,9 @@
if ((entry->d_type & DT_DIR)>0) {
list_subfolder(folder + '/' + entry->d_name, entry->d_name, prefix + " ");
} else {
- std::cout << prefix << " " << entry->d_name << "\n";
+ struct stat st;
+ stat((folder + '/' + entry->d_name).c_str(), &st);
+ std::cout << prefix << " " << entry->d_name << " S:" << st.st_size << "\n";
}
}
closedir(d);
--
Gitblit v1.9.3