- #include <stdio.h>
- #include <io.h>
- #include <fcntl.h>
- #include <sysstat.h>
- void main (int argc, char *argv[])
- {
- int file_handle;
- long file_size;
- if ((file_handle = open(argv[1], O_RDONLY)) == -1)
- printf("Error opening the file %dn", argv[1]);
- else
- {
- file_size = filelength(file_handle);
- printf("The file size in bytes is %ldn", file_size);
- close(file_handle);
- }
- }