All pastes #987994 Raw Edit

r0nys

public c v1 · immutable
#987994 ·published 2008-04-17 04:10 UTC
rendered paste body
#include <sys/types.h>#include <sys/stat.h>#include <unistd.h>#include <fcntl.h>int main(int argc,char *argv[]){      if (argc!=2){  printf("Usage:%s filename\n",argv[0]);exit();}      struct stat buffer;      int status,filedes;      filedes = open(argv[1],O_RDWR);      if (filedes == -1)           {              printf("file not found\n");              exit ();           }      status = fstat(filedes,&buffer);      //printf("status = %d\n",status);      printf("uid = %d\n",buffer.st_uid);      printf("gid = %d\n",buffer.st_gid);      printf("inode = %d\n",buffer.st_ino);      printf("hardlinks = %d\n",buffer.st_nlink);      printf("device= %d\n",buffer.st_dev);      printf("mod = %d\n",buffer.st_mode);      printf("device ID = %d\n",buffer.st_rdev);      printf("size(in bytes) = %d\n",buffer.st_size);      printf("block size = %d\n",buffer.st_blksize);      printf("blocks = %d\n",buffer.st_blocks);      printf("last access time = %d\n",buffer.st_atime);      printf("last modification time = %d\n",buffer.st_mtime);      printf("last status change time = %d\n",buffer.st_ctime);      return 0;}