Section 4 from
Reading and writing with files
. More
precisely, the library functions fseek
, and
ftell
. You may use the man command in
the command interpreter to obtain this information.
File main.c
of the activity
“
The version control system Subversion
” in the folder
fopen_fclose
.
Write a function with the following prototype:
static long get_file_size(FILE * file);
This function returns the size in bytes of the file given as
parameter that must be previously opened. In the main
program,
add a line that calls this function and prints the size of the given file on
the screen. Check with files already stored in your folder that this size is
identical to the one obtained with the command ls -l
(the fourth
column shows the file size in bytes).
Once the function has been coded and verified by running a program, upload it to Subversion. Then, show it to the tutor.