Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File size using ifstream

Status
Not open for further replies.

UmaGrama

Technical User
Sep 8, 2003
33
BR
Hi all,

Does anybody know a way to find out the size of a file? I read in a file using ifstream and I was hoping to put a progress bar in my program though the file size is changing therefore I cannot have a constant stepping in the progress bar.

Any ideas?
 
From the back of my mind, you can use seek to go from the beginning of the file to the ending of the file and counting the number of bytes. Unfortunately, I can't find my notes to give you an example. I'll keep looking if you want.


James P. Cottingham

When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity.
[tab][tab]Albert Einstein explaining his Theory of Relativity to a group of journalists.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top