Win32 API (although I know I should be talking about .NET here) has a
GetFileSize API. The one advantage of this is that it is capable of
reporting file sizes larger than 4Gb, because it uses two DWORDs for the
result. If you're not dealing with huge files then this is not an issue of
course, and I'd recommend stat as previously advised.
Kevin
"Bruno van Dooren" <br**********************@hotmail.com> wrote in message
news:E3**********************************@microsof t.com...
Hi ,
I wrote the following code in c++ (native) to get file size:
int o_get_file_length(const char * filename)
{
ifstream f (filename, ios::binary );
f.seekg (0, ios::end );
int length = f.tellg ();
f.close();
return length;
}
You could use the stat or _fstat functions.
--
Kind regards,
Bruno.
br**********************@hotmail.com
Remove only "_nos_pam"