Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to determine the size of a file using C++? .

0 views
Skip to first unread message

fdu...@yahoo.com

unread,
Aug 14, 2002, 4:11:48 PM8/14/02
to
I was having problem getting the filesize using
GetFileSize. This is how I called the function:
GetFileSzie("filename", NULL)... is this the right way to
do this?

What I'm trying to do is to keep writing to a file until
it reaches a certain size. I'm comparing my MAX size with
the current size of the file, if it reaches the MAX size,
then exit out. How do I do this exactly? I'm trying to
use GetFileSize to do this, but I am having a hard time
doing so.

Igor Tandetnik

unread,
Aug 14, 2002, 4:18:50 PM8/14/02
to
GetFileSize accepts a file handle, not a file name. This is the same
handle you obtain with CreateFile and use in WriteFile. Exactly what
problem do you classify as "a hard time"?
--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken

<fdu...@yahoo.com> wrote in message
news:264e01c243ce$d2134f40$3aef2ecf@TKMSFTNGXA09...

0 new messages