daily pastebin goal
80%
SHARE
TWEET

Untitled

a guest Mar 26th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. filesizefromfile nie moze zmieniac wskaznika na plik, wiec musisz najpierw zapisac, potem obliczac size
  2. a wiec musi to u Ciebie wygladac tak:
  3.     if(f==NULL)
  4.     {
  5.         return -2;
  6.     }
  7.     int pozycja = ftell(f); //!
  8.     fseek(f,0,SEEK_END);
  9.     int wyn=ftell(f);
  10.     fseek(f, pozycja, SEEK_SET); // !
  11.     fclose(f);
  12.     return wyn;
  13.    
  14. filesizefrom path przekombinowane, wystarczy tak:
  15.  
  16.   if(fname == NULL)
  17.     return -2;
  18.   FILE *fp = fopen(fname, "r");
  19.   if(fp == NULL) return -1;
  20.   fseek(fp, 0, SEEK_END);
  21.   int size = ftell(fp);
  22.  
  23.   fclose(fp);
  24.   return size;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top