15.08.2010, 04:00
This will return in what range a file size is in.. supports Bytes, KB, MB, and GB...
Код:
GetFileSizeInBytes(file[]) { if(!fexist(file)) return 0; new t; new kb,mb,fl; new File:raw; raw = fopen(file); fl = flength(raw); mb = 1073741824/fl; kb = 1024/fl; if(fl > 1024 && fl < 1048576) { return 1; // 1 = file is in KB } if(fl >= 1048576) { return 2; // 2 = file is in MB } if(fl >= 1073741824) { return 3; // 3 = file is in GB } return 4; }
![Cool](images/smilies/cool.gif)