Detecting disksize
-
- Posts: 8
- Joined: Mon Feb 08, 2010 11:13 am
Detecting disksize
Does anyone know how to call the kernel32.dll function GetDiskFreeSpaceW
and how to get a value from this function?
and how to get a value from this function?
Re: Detecting disksize
any Reason why not using Xbase++ DiskSpace() ?hm@mpsg.net wrote:Does anyone know how to call the kernel32.dll function GetDiskFreeSpaceW
and how to get a value from this function?
greetings by OHR
Jimmy
Jimmy
Re: Detecting disksize
@10.5, 18 dcsay 'Size '
@10.5, 36 dcsay transform(disktotal(CurDrive()),"999,999,999,999,999" )
@10.5, 65 dcsay 'Free '
@10.5, 76 dcsay transform(diskfree(CurDrive()),"999,999,999,999,999" )
I use this to show size and amt free
Hope it helps.....
@10.5, 36 dcsay transform(disktotal(CurDrive()),"999,999,999,999,999" )
@10.5, 65 dcsay 'Free '
@10.5, 76 dcsay transform(diskfree(CurDrive()),"999,999,999,999,999" )
I use this to show size and amt free
Hope it helps.....
There are only 10 kinds of people - those who understand binary and those who don't 

Re: Detecting disksize
I can't get GetDiskFreeSpaceW() unicode version to work, but GetFreeDiskSpaceA() works fine:
Put this in your source somewhere:
Here's how it is used:
Put this in your source somewhere:
Code: Select all
#include "DLL.CH"
DLLFUNCTION GetDiskFreeSpaceA( a, @b, @c, @d, @e ) USING STDCALL FROM KERNEL32.DLL
Code: Select all
a := 'C:\'
b := 0
c := 0
d := 0
e := 0
GetDiskFreeSpaceA( a, @b, @c, @d, @e )
? b, c, d, e
The eXpress train is coming - and it has more cars.
-
- Posts: 8
- Joined: Mon Feb 08, 2010 11:13 am
Re: Detecting disksize
Thank you Roger
GetDiskFreeSpaceA() works.
GetDiskFreeSpaceA() works.
Re: Detecting disksize
I´m using Xbase++ 2.0 Build 2.00.656 and
disktotal()
diskfree()
documented and should be on xbtbase.dll
Does not work.
I found xbtbase1.dll and xbtbase2.dll but no xbtbase.dll
Any idea?
disktotal()
diskfree()
documented and should be on xbtbase.dll
Does not work.
I found xbtbase1.dll and xbtbase2.dll but no xbtbase.dll
Any idea?
Re: Detecting disksize
There never was an XBTBASE.DLL. They were always XBTBASE1.DLL and XBTBASE2.DLL.
The eXpress train is coming - and it has more cars.
Re: Detecting disksize
There is a mistake in xBase++ 2.0 help file.
And disktotal() causes an error
C:\DEV\SEGOVI.obj: error ALK2102: unresolved external symbol DISKTOTAL
ALINK: fatal error ALK4102: 1 external symbols unresolved
Is there another way to get the total size of a disk?
This is the help file information.
DiskTotal()
Determines the total storage capacity of a disk in bytes.
DiskTotal( [<cDrive>] ; // Default: CurDrive()
) --> nTotalStorageCapacity
Description
<cDrive> defaults to the current drive. It can be specified as a drive letter without a colon.
See also
DiskFree()
File info
Dynamic library
XBTBASE.DLL
And disktotal() causes an error
C:\DEV\SEGOVI.obj: error ALK2102: unresolved external symbol DISKTOTAL
ALINK: fatal error ALK4102: 1 external symbols unresolved
Is there another way to get the total size of a disk?
This is the help file information.
DiskTotal()
Determines the total storage capacity of a disk in bytes.
DiskTotal( [<cDrive>] ; // Default: CurDrive()
) --> nTotalStorageCapacity
Description
<cDrive> defaults to the current drive. It can be specified as a drive letter without a colon.
See also
DiskFree()
File info
Dynamic library
XBTBASE.DLL
Re: Detecting disksize
#include "DLL.CH"
DLLFUNCTION GetDiskFreeSpaceA( a, @b, @c, @d, @e ) USING STDCALL FROM KERNEL32.DLL
a := 'C:\'
b := 0
c := 0
d := 0
e := 0
GetDiskFreeSpaceA( a, @b, @c, @d, @e )
? b, c, d, e
In this example from Roger Donnay,
b is nb of sectors per cluster
c is nb of bytes per sector
d is nb of free clusters
e is nb of total clusters
total of free bytes is (d x b x c)
total of bytes is (e x b x c)
DLLFUNCTION GetDiskFreeSpaceA( a, @b, @c, @d, @e ) USING STDCALL FROM KERNEL32.DLL
a := 'C:\'
b := 0
c := 0
d := 0
e := 0
GetDiskFreeSpaceA( a, @b, @c, @d, @e )
? b, c, d, e
In this example from Roger Donnay,
b is nb of sectors per cluster
c is nb of bytes per sector
d is nb of free clusters
e is nb of total clusters
total of free bytes is (d x b x c)
total of bytes is (e x b x c)
Re: Detecting disksize
I found out that XBTBASE.DLL and all functions related to it is part of XBTOOLS III that must be installed separately.
Some interesting functions like
Serial ports
Disk related
Printers
In the help file of xbase++ if you see on the bottom the reference to XBTBASE.DLL it has to do with XBTOOLS III.
You can fine more help on the Xbase++ help under XBTOOLS III Reference.
Some interesting functions like
Serial ports
Disk related
Printers
In the help file of xbase++ if you see on the bottom the reference to XBTBASE.DLL it has to do with XBTOOLS III.
You can fine more help on the Xbase++ help under XBTOOLS III Reference.