Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>filesize</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
filesize

Usage

   #include <io.h>
   long filesize(char *filename);

Description

   filesize determines the size of a file in bytes. The filename must be an
   existing file that is not currently open.

Example 

   #include <io.h>
   #include <stdio.h>
   #include <stdlib.h>

   int main()
   {
       long size;

       size = filesize ("file.dat");
       printf("The filesize of file.dat is %ld \n",size);
       return EXIT_SUCCESS;
   }

Return Value

   The length of the file in bytes is returned upon success, otherwise a -1L
   is returned and errno is set.

See Also

   stat, fstat



See Also: stat fstat

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson