Wednesday 9 September 2009

WRITE A C PROGRAM TO FIND SIZE OF A FILE




#include 





#include 



#include 



void main()

{

    struct stat status;

    FILE *fp;

    fp=fopen("test.txt","r");

    fstat(fileno(fp),&status);

    clrscr();

    printf("Size of file : %d",status.st_size);

    printf("Drive name   : %c",65+status.st_dev);

    getch();



}





Explanation:



Function int fstat (char *, struct stat *) store the

No comments:

Post a Comment