Home » NO IDEA » File Attributes

File Attributes

Blog Stats

  • 15,880 hits
April 2013
M T W T F S S
« Mar   Oct »
1234567
891011121314
15161718192021
22232425262728
2930  

#include<stdio.h>
#include<unistd.h>
#include<errno.h>
#include<sys/stat.h>
int main()
{
struct stat statv;
if(stat("/home/ganesh/mani.c",&statv)==-1)
perror("document not found");
else
{
printf("\n The file user id is %d",statv.st_uid);
printf("\n The file group id is %d",statv.st_gid);
printf("\n The file size id is %d",statv.st_size);
printf("\n The file inode number is %d",statv.st_ino);
}
return 0;
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: