PDA

View Full Version : Get System Info(Total Disk Space)



NewsArchive
08-20-2012, 04:20 AM
Hi Friedrich,

is there a function "Get System Info(Total Disk Space)" or something
similar in SB?

Thanks for your answer.

Markus

NewsArchive
08-20-2012, 04:20 AM
Hi Markus,

> is there a function "Get System Info(Total Disk Space)" or something
> similar in SB?

No, there is only a "Get System Info(Free Disk Space)" function in SB.

Friedrich

NewsArchive
08-20-2012, 06:42 AM
Do you know a possibility, how I can get this information?

Markus Zander

NewsArchive
08-20-2012, 06:43 AM
Markus,

>
> Do you know a possibility, how I can get this information?
>

If the system supports the "GetDiskFreeSpaceEx" API then it should be
possible to use this API to retrieve the total number of bytes (3rd
parameter):

http://msdn.microsoft.com/en-us/library/windows/desktop/aa364937(v=vs.85).aspx

If the system only supports the "GetDiskFreeSpace" API then you have to
calculate it on basis of the sector per clusters, bytes per sector and total
number of clusters return values.

I think it should be possible to add this as an built-in feature to SB.
We'll check this.

Friedrich

NewsArchive
08-20-2012, 06:43 AM
Thanks, I'll try this.

What's about this one:

http://msdn.microsoft.com/en-us/library/windows/desktop/bb762176(v=vs.85).aspx


Markus

NewsArchive
08-20-2012, 06:43 AM
Markus,

> What's about this one:
>
> http://msdn.microsoft.com/en-us/library/windows/desktop/bb762176(v=vs.85).aspx

Yes, if the target systems do have the required Shell32.dll available then
you can use this function. But it does the same as the method I suggested.
If GetDiskFreeSpaceEx is not available then it falls back to
GetDiskFreeSpace.

SetupBuilder does not use SHGetDiskFreeSpace but (dynamically) calls to
GetDiskFreeSpaceEx or GetDiskFreeSpace Windows APIs.

Friedrich

NewsArchive
08-20-2012, 06:45 AM
Bonjour Fredrich,

For info (I know .... <g>) vuFileTools has such a function Markus could
call from a clarion dll
__________________________________________________ _____
vuDiskSpace(Drive)
This function will return the actual size of a disk, in bytes. Any
size disk can be measured with no ‘2 Gigabyte limit’ that was imposed
on older systems.

Calling Parameters

Drive Cstring(2)

Calling Parameters Values

Drive = ‘C’

Returns

A null terminated string containing the size of the drive (does not
have a 2G limit)

Example

LOC:Size Real

LOC:Drive = ‘C’

LOC:Size = vuDiskSpace(LOC:Drive)

(My C Drive returned 80,023,715,840)

Message(‘C Drive is ‘ & vuDiskSpace(LOC:Disk) & ‘ bytes’)

NOTE: This function requires Windows 98 or higher

--
JP
__________________________________________________ _____

For those who do not understand ... : "Qui bene amat bene castigat."
__________________________________________________ _____

DMC - Data Management Center : a tool to let you Migrate Import Export
Transfer your Data
www.dmc-fr.com

NewsArchive
08-21-2012, 02:11 AM
"Get System Info (Total Disk Space)" function added.

Friedrich

NewsArchive
08-21-2012, 02:11 AM
Thanks.

Markus Zander