/*
TITLE:IMPLEMENTATATION OF INODE USING C.
*/
#include<sys/types.h>
#include<ustat.h>
#include<stdio.h>
#include<sys/dir.h>
main(argc,argv)
int argc;
char *argv[];
{
FILE *fp;
struct direct dir;
fp=fopen(argv[1],"r");
printf("\n Directory listing of %s\n",argv[1]);
while(fread(&dir,sizeof(dir),1,fp)!=EOF)
{
if(dir.d_ino==0)
continue;
printf("inode number:%d of file:%s\n",dir.d_ino,dir.d_name);
}
fclose(fp);
exit(0);
}
No comments:
Post a Comment