[Dev-C++] Res: 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 17:17:14
|
Hi,=0A=0AI think i got it;; =0AThe problem is becouse GetFileSize() works w=
ith a handle and I was using a FILE * ...so I think that if I use the Open=
File() function I can solve my problem...=0A=0ABut;...until now I haven=B4t=
found an good example on how to use OpenFile() so..if anyone knows how...c=
ould give me a help....ok!?!=0A=0AThanks=0A=0AKrownix=0A=0A=0A----- Mensage=
m original ----=0ADe: KrowniX ()--() <kr...@ya...>=0APara: dev-cpp=
-us...@li...=0AEnviadas: Quinta-feira, 7 de Dezembro de 200=
6 12:43:15=0AAssunto: [Dev-C++] error while using the GetFileSize() funtion=
=0A=0A=0AHello..=0A =0AI got a new situation here ...now I have to verify e=
very 5 minuts the size of a file, but I am using the GetFileSize() function=
but it=B4s result it isn=B4t like de DIR command results, ex:=0A =0AMy cod=
e:=0Avoid TestSizeLog() {=0A FILE *fp; //ponteiro para o arquivo criado=
=0A DWORD sizeLog; //armazena arquivo=0A=0A if(!(fp=3Dfopen("c:\\ar=
q.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::cout << "File Size: " << sizeLog << std::endl;=0A} =0A =0Athe re=
sult of my code:=0AC:\>"\Documents and Settings\p550826\Desktop\progs\Event=
Viewer\testFile.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.874 bytes=0A =0ASo.....where is my error?? =0ADoes anyone has =
any idea??=0A =0AThanks=0AKrownix=0A=0A=0A=0AYahoo! Search=0AM=FAsica para =
ver e ouvir: You're Beautiful, do James Blunt=0A---------------------------=
----------------------------------------------=0ATake Surveys. Earn Cash. I=
nfluence the Future of IT=0AJoin SourceForge.net's Techsay panel and you'll=
get the chance to share your=0Aopinions on IT & business topics through br=
ief surveys - and earn cash=0Ahttp://www.techsay.com/default.php?page=3Djoi=
n.php&p=3Dsourceforge&CID=3DDEVDEV=0A______________________________________=
_________=0ADev-cpp-users mailing lis...@li...=
t=0ATO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm=0Ahttps=
://lists.sourceforge.net/lists/listinfo/dev-cpp-users=0A=0A=0A=09=0A=0A=0A=
=0A=09=0A=09=09=0A_______________________________________________________ =
=0AVoc=EA quer respostas para suas perguntas? Ou voc=EA sabe muito e quer c=
ompartilhar seu conhecimento? Experimente o Yahoo! Respostas !=0Ahttp://br.=
answers.yahoo.com/ |