Querying file properties (byte size, inode number, permissions, modification times) in C programs is executed using the POSIX stat() system call.
C stat System Call Example
#include <stdio.h>
#include <sys/stat.h>
int main() {
struct stat file_info;
if (stat("main.c", &file_info) == 0) {
printf("File Size: %ld bytes\n", file_info.st_size);
printf("Inode: %ld\n", file_info.st_ino);
}
return 0;
}
Comments and corrections