Welcome! Log In Create A New Profile

Advanced

DriveInfo not showing correct info

Posted by MikePace 
DriveInfo not showing correct info
November 09, 2018 11:28AM
I am trying to use the function: ResDiskSize is int = fDriveInfo("C:", fdTotalSpace)
to get drive information.

The result I get is not correct.

My C: drive is 256GB the result i get is 750GB. The free space "fdFreeSpace" function also produces incorrect data.
I must be doing something wrong any ideas?
Re: DriveInfo not showing correct info
November 09, 2018 11:57AM
Hi, really? In the past I've been using these functions a lot but never had a feedback of our customers about errors. Maybe, there's a difference when running a 64-bit vs. 32-bit application?
Re: DriveInfo not showing correct info
November 09, 2018 05:03PM
Hi Mike,
remember you are getting back a result in bytes.
So you may have an overflow when using a simple int
Try double int

Regards
Steven Sitas
Re: DriveInfo not showing correct info
November 12, 2018 08:48AM
thanks for the response. I did question that and placed the result in a string to check. the result is the same. None of the drive reflect correctly. I have done a rebuild, recompile etc but still the results are incorrect.
Re: DriveInfo not showing correct info
November 12, 2018 09:25AM
Hi Mike,

Just try this piece of code:

Info(LengthToString(fDriveInfo("C:", fdTotalSpace), sizeGB ) )

According to the help the result should be stored in Numeric type variable.

Regards

Vassilis
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: