For Programmers: Free Programming Magazines  


Home > Archive > Clarion > March 2004 > GetDiskFreeSpaceEX API Problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author GetDiskFreeSpaceEX API Problem
Jeffrey Willias

2004-03-26, 11:01 pm

The information retrieved by a GetDiskFreeSpaceEX API call is stored as a
ULARGE_INTEGER data type (64-bit integer). I believe that Visual C forms
this data type through a union of two 32-bit integers. Is it possible to
form a 64-bit integer in a similar manner in C5.5 EE? Is there a better
method to get the correct amount of free disk space remaining for large
drives? I was hoping that C6.0 would include a 64-bit integer as a simple
data type but I didn't see it in the documentation.

I was about to develop a .dll under VC to link in my application but
thought there must be a cleaner and easier way to solve this problem.

Thank you,
Jeff Willias
(Replace this text with a title that relates complete command over a
meaningless repetitive task)


Drazen Karamatic

2004-03-26, 11:01 pm

Na newsima:Nqz3c.27736$Wc4.3770@newssvr24.news.prodigy.com,
Jeffrey Willias <jeffreyw@sbcglobal.net> se trudio da natipka:
> The information retrieved by a GetDiskFreeSpaceEX API call is stored
> as a ULARGE_INTEGER data type (64-bit integer).


Hi Jeffrey

I'm using GetDiskFreeSpace API call instead of GetDiskFreeSpaceEx
Call looks like:

If
GetDiskFreeSpace(Drive,SectorsPerCluster
,BytesPerSector,NumberOfFreeClust
ers,TotalNumberOfClusters)<>0

MBFree=SectorsPerCluster*BytesPerSector*
NumberOfFreeClusters/(1024^2)
End


So you do not need any 64 bit variables...


Jeffrey Willias

2004-03-26, 11:01 pm

Drazen,

Thank you for the quick response. I had read that the GetDiskFreeSpace API
call was not reliable for large drives and, therefore, did not attempt to
use it. Your information supplies an easy solution for my problem and is
greatly appreciated.

"Drazen Karamatic" <drazen.karamatic@zg.htnet.hr> wrote in message
news:pGB3c.6167$%x4.779664@news.siol.net...
>
> I'm using GetDiskFreeSpace API call instead of GetDiskFreeSpaceEx
> Call looks like:
>
> If
> GetDiskFreeSpace(Drive,SectorsPerCluster
,BytesPerSector,NumberOfFreeClust
> ers,TotalNumberOfClusters)<>0
>
> MBFree=SectorsPerCluster*BytesPerSector*
NumberOfFreeClusters/(1024^2)
> End
>
>
> So you do not need any 64 bit variables...
>
>



Drazen Karamatic

2004-03-26, 11:01 pm

Na newsima:doE3c.8713$VP5.4309@newssvr23.news.prodigy.com,
Jeffrey Willias <jeffreyw@sbcglobal.net> se trudio da natipka:
> Drazen,
>
> Thank you for the quick response. I had read that the
> GetDiskFreeSpace API call was not reliable for large drives and,
> therefore, did not attempt to use it. Your information supplies an
> easy solution for my problem and is greatly appreciated.



GetDiskFreeSpace is not reliable under W95 and drives larger than 2GB...


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com