User Profile

Collapse

Profile Sidebar

Collapse
steveski74
steveski74
Last Activity: Oct 10 '07, 02:27 AM
Joined: Aug 20 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • steveski74
    replied to File Size
    in C
    Why not stick to the old faithful ? :

    Code:
    long FileSize(char* filename)
    {
      struct stat stbuf;
      stat(filename, &stbuf);
      return stbuf.st_size;
    }
    That's the method described in "The C Programming Language" is much simpler than any other technique, plus you get access to all this as well:

    Code:
    struct stat   /* inode information returned by stat */
    ...
    See more | Go to post

    Leave a comment:


  • steveski74
    replied to How to find out file's text length
    in C
    Why not stick to the old faithful ? :

    Code:
    long FileSize(char* filename)
    {
      struct stat stbuf;
      stat(filename, &stbuf);
      return stbuf.st_size;
    }
    That's the method described in "The C Programming Language" is much simpler than any other technique, plus you get access to all this as well:

    Code:
    struct stat   /* inode information returned by stat */
    ...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...