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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File Allocation Size

Status
Not open for further replies.

philselmer

Programmer
Jun 14, 2005
3
US
Does anyone know what function/library would be used to get the allocated size of a file? I need the amount of memory taken by the file, not the current size. Thanks for your help.
 
Yes. "Size on disk" is what I am looking for. The GetStoreInformation() function seems like it would do what I want, but MSDN documentation says it is for WinCE only.

I assume there is a way to get the size on disk because GetCompressedFileSize returns that if you pass in a path of a compressed file. Pass in a non compressed file and you get the exact same thing that GetFileSize does.

A function to find the file allocation size for the disk would be helpful too. The computers I am using have 4K clusters (partition larger than 2Gb) and most of the computers that the program gets deployed on have 2K clusters (2Gb partition). Any ideas for getting the cluster size?
 
i suggest you try using the function because i have used other functions that it says are for CE on windows 98/2000/xp. i have never used this function, but it doesn't hurt to give it a shot!

other than that, i'm not sure how else you can get it! sorry!
 
I was researching it for another developer. He ended up hard coding it for a 2K cluster because our test machines in the lab are set up like that. I will keep it in mind in the future. Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top