I want to be able to store the bytes written to disk in a variable, however, a long won't do. So I figured if I had the size of (long * long) I would be able to store enough bytes.
Also, how can I use the Windows API to determine how much diskspace there is free?
If you wonder why I can't do with 2 million or 4.2 million, I am writing a DiskSweeper. It writes 5 times random data into a file. However I want to show the user a sort of progress and how much data there is done.
Sand Hawk
----------------
-Earth is 98% full. Please delete anybody you can.
My Site
[edited by - Sand_Hawk on November 5, 2002 3:46:12 PM]
Variable with the size of (long * long) and disk space determination
With Visual C++, a 64-bit integer is
__int64
. And the API for determining free disk space is GetDiskFreeSpaceEx
. If I had my way, I''d have all of you shot!
codeka.com - Just click it.
you could also try
unsigned int bigAssVariable : 999999999999999999999999 (insert your choice of massive number here)
I think this defines the size of the int in bits, but you''ll have to check it, ''cos I don''t have a C++ compiler with me
unsigned int bigAssVariable : 999999999999999999999999 (insert your choice of massive number here)
I think this defines the size of the int in bits, but you''ll have to check it, ''cos I don''t have a C++ compiler with me
ChaosEngine: That last one won''t work, because you can only define custom variables types with a custom bit length inside a struct and they need to align to 8 bits.
DeanHarding: Thanks, I will work on it when I get home
----------------
-Earth is 98% full. Please delete anybody you can.
My Site
DeanHarding: Thanks, I will work on it when I get home
----------------
-Earth is 98% full. Please delete anybody you can.
My Site
So define it inside a struct then and align it to 8 bits!
you read in data in 8bit sizes anyway....
you read in data in 8bit sizes anyway....
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement