Forum > Windows

Get Free space of Disk or USB

(1/3) > >>

eldonfsr:
How i can get free space  of usb or any disk on windows
DiskFree(0) is current disk how i can ask for disk F or H

trev:
Please see the FPC documentation for diskfree for how to do this.

eldonfsr:
thanks trev  i read and tested but don't accept send string parameters only numbers how i can know what is number for hdd H, on linux sad use adddisk() but on windows is not available...
.

winni:
Hi!

0 = current drive.
1 = A:
2 = B:
3 = C:
4 = D:
5 = E:
....


Winni


mas steindorff:
that works if you know that you are after  D: or E:

GetDiskFreeSpace() takes the drive as a string (cast to pchar) and returns lots of info you may find useful.

you can use getDriveType() to find out if it is ...
  TDrvType = (dtNotDetermined, dtNonExistent, dtRemoveable,
              dtFixed, dtRemote, dtCDROM, dtRamDrive);
and you can use
GetVolumeInformation() to get the volume name use full if you named your USB drive and it is one of several pulled into the system.
It's been a while since I worked on my "diskutil" unit but I believe they are all built ins.
my uses ...
  windows   ,fileutil   ,process   ,jwadbt   ; 
incase you can not find something.



Navigation

[0] Message Index

[#] Next page

Go to full version