Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calculating free disk space

What is the best method for calculating free disk space using C++ only. My target platform is WinCE but most of the file operations are the same as normal Windows.

like image 880
Chris Avatar asked Feb 28 '23 00:02

Chris


2 Answers

You mean usage as in how much space is left? then try GetDiskFreeSpace()
Or do you mean, number of reads/writes/current files open, speed etc?

like image 61
Martin Beckett Avatar answered Mar 04 '23 00:03

Martin Beckett


OpenStore + GetStoreInfo. STOREINFO gets you the used size, BytesPerSector * (NumSectors - FreeSectors).

like image 22
Hans Passant Avatar answered Mar 04 '23 00:03

Hans Passant