Add Getting Information About Floppy Disk Or Partitions


Getting Information About Floppy Disk Or Partitions:

You can find all informations about your floppy drive or one of your partition by using this function:
BOOL GetDiskFreeSpace(

LPCTSTR lpRootPathName, // address of root path
LPDWORD lpSectorsPerCluster, // address of sectors per cluster
LPDWORD lpBytesPerSector, // address of bytes per sector
LPDWORD lpNumberOfFreeClusters, // address of number of free clusters
LPDWORD lpTotalNumberOfClusters // address of total number of clusters
);


Parameters

lpRootPathName

Points to a null-terminated string that specifies the root directory of the disk to return information about. If lpRootPathName is NULL,
the function uses the root of the current directory.

lpSectorsPerCluster

Points to a variable for the number of sectors per cluster.

lpBytesPerSector

Points to a variable for the number of bytes per sector.

lpNumberOfFreeClusters

Points to a variable for the total number of free clusters on the disk.

lpTotalNumberOfClusters

Points to a variable for the total number of clusters on the disk.


Return Value :
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.

Example:
This Procedure calculates the free and the total space of floppy (if it is A:\):

procedure Calculate(Total_Space : Real, Freespace : Real );
var d1, d2, d3, d4 : dword;
begin
if getdiskfreespace('A:\', d1, d2, d3, d4) then
begin
Total_space := d1 * d2 * d4;
Free_Space := d1 * d2 * d3;
end;
end;
Related Discussions
  • FRIENDS IN DELPHI ?? (OR OTHER ACCESS WORKAROUNDS) (2001-01-04 11:08:37)
    One of the quirks of Delphi is that classes in the same unit can access protected and private methods and variables. Borland does this a lot in...
  • ADD TO RESOURCE ON RUNTIME (2001-01-04 11:00:49)
    I think what you are asking is to change the .EXE file at run-time. Yes, it is possible, but nobody I found will share that information. If you...
  • HOW TO LOAD INI INTO A DLL (2001-01-05 16:43:45)
    unfortunatelly I haven't found anything interesting in the win32api help. I tried different methods. It seems like it is loading the data while...
  • TOO STUPID TO WORK OUT HOW TO USE GETKEYBOARDSTATE (2001-01-07 00:32:24)
    GetKeyboardState just gets the information of the input devices. For example: var KS: TKeyboardstate; GetKeyBoardState(KS); //0=OFF...
  • MODBC MTABLE.POST - WHY DOESN'T WORK? (2001-01-07 11:32:50)
    Thanks for help :) I use Access database, and my 'ID' field is the standard unique field generated by Access. I've tried to set the field type...
  • ABOUT THE TIME...? (2001-01-10 20:05:50)
    Yes. See the thread about opening control panel applets. -- The Smurf
  • PRINTING........??? (2001-01-09 10:44:49)
    Do you want to achieve information from the printer device as it is printing the specific job? Do you want to snap every print requests on the...
  • MESSAGE DIALOGS... (2001-01-10 14:21:18)
    Here goes a trick from Borland http://www.borland.com/devsupport/delphi/downloads/index.html To translate the Delphi 3.0 VCL messages, you need...
  • BDE INSTALLATION KIT (2001-01-11 05:04:48)
    Yes, you can install BDE without the use of InstallShield. (Even thu it's easy'er to do it with InstallShield Express) First you need all of...
  • PRINTING... (2001-01-15 12:49:37)
    U could do it the simple way. Something like this button1.visible:=false; button2.visible:=false; print; button1.viasible:=true;...
Latest News
Submit News Form Past News
Latest Forum Entries