Advertisement
AbraaoAllysson

retornando o tamanho do arquivo

Jun 16th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. long getSize(string name)
  2. {
  3.    
  4.     FILE* arch = fopen(&name[0], "r");
  5.     long actualPos = ftell(arch);
  6.     long sizeArch;
  7.  
  8.     fseek(arch, 0, SEEK_END);
  9.     sizeArch = ftell(arch);
  10.  
  11.     fseek(arch, actualPos, SEEK_SET);
  12.     fclose(arch);
  13.    
  14.  
  15.     return sizeArch;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement