about summary refs log tree commit diff
path: root/csrc/stat.c
diff options
context:
space:
mode:
authormakefunstuff <[email protected]>2024-07-13 22:04:48 +0200
committermakefunstuff <[email protected]>2024-07-13 22:04:48 +0200
commit714036825c38be947eb88a82c02425d7932d2919 (patch)
treec6723bd239fa5cc93b78ef9e9b7ba5576f708db1 /csrc/stat.c
parent9b9e63476616a123eb4d00f87f677ef2d9478897 (diff)
downloadtinkerbunk-714036825c38be947eb88a82c02425d7932d2919.tar.gz
upd
Diffstat (limited to 'csrc/stat.c')
-rw-r--r--csrc/stat.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/csrc/stat.c b/csrc/stat.c
new file mode 100644
index 0000000..fb60302
--- /dev/null
+++ b/csrc/stat.c
@@ -0,0 +1,15 @@
+#include "stat.h"
+
+stat_res_t mstat(char *file) {
+  struct stat fileStat;
+
+  if (stat(file, &fileStat) < 0) {
+    return STAT_ERR;
+  }
+
+  printf("File Size: %ld bytes\n", fileStat.st_size);
+  printf("Number of Links %ld\n", fileStat.st_nlink);
+  printf("File inode: %ld\n", fileStat.st_ino);
+
+  return STAT_OK;
+}