[Dev-C++] error while using the GetFileSize() funtion
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: KrowniX \(\)--\(\) <kr...@ya...> - 2006-12-07 14:43:28
|
Hello..=0A=0AI got a new situation here ...now I have to verify every 5 min=
uts the size of a file, but I am using the GetFileSize() function but it=B4=
s result it isn=B4t like de DIR command results, ex:=0A=0AMy code:=0Avoid T=
estSizeLog() {=0A FILE *fp; //ponteiro para o arquivo criado=0A DWO=
RD sizeLog; //armazena arquivo=0A=0A if(!(fp=3Dfopen("c:\\arq.dat", "r"=
))) {=0A std::cout << "Erro ao abrir arquivo de log" << std::endl;=
=0A exit(1);=0A }=0A sizeLog=3DGetFileSize(fp, NULL); =0A =
sizeLog/=3D(1024*1024); //transforma bytes em megabytes=0A std::cou=
t << "File Size: " << sizeLog << std::endl;=0A} =0A=0Athe result of my c=
ode:=0AC:\>"\Documents and Settings\p550826\Desktop\progs\EventViewer\testF=
ile.exe"=0AFile Size: 4095=0A=0Athe result of a DIR command:=0A07/12/2006 =
10:13 33.166.874 arq.dat=0A 1 arquivo(s) 33.166.87=
4 bytes=0A=0ASo.....where is my error?? =0ADoes anyone has any idea??=0A=0A=
Thanks=0AKrownix=0A=0A=0A=09=09=0A_________________________________________=
______________ =0ANovidade no Yahoo! Mail: receba alertas de novas mensagen=
s no seu celular. Registre seu aparelho agora! =0Ahttp://br.mobile.yahoo.co=
m/mailalertas/ =0A =0A |