about summary refs log tree commit diff
path: root/csrc/stat.c
blob: fb603026eaa93ead783728e3890e45abe563e36d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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;
}