Created
September 4, 2012 22:23
-
-
Save dlion/3627379 to your computer and use it in GitHub Desktop.
sizeFile function, return size of a file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| long sizeFile(FILE *file) | |
| { | |
| long pos_now,size; | |
| //Posizione attuale | |
| pos_now = ftell(file); | |
| //Mi posiziono alla fine del file | |
| fseek(file,0,SEEK_END); | |
| //Prendo la dimensione | |
| size = ftell(file); | |
| //Ritorno alla posizione precedente | |
| fseek(file,pos_now,SEEK_SET); | |
| //Ritorno la dimensione | |
| return size; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment