Board index » delphi » DiskSize doesn't seem to work

DiskSize doesn't seem to work

I am probably overlooking something, but the function DiskSize doesn't seem
to work.

When trying to find out if a floppy drive is 1.44Mb I use DiskSize.

var
  disk_size : int64;
  drive : byte;

begin
     drive := 1;
     disk_size := DiskSize(drive);
end;

afterwards disk_size is always 33204512428815727 which isn't a correct
result.

What should I do instead?

tia,
Magne

 

Re:DiskSize doesn't seem to work


Quote
> I am probably overlooking something, but the function DiskSize doesn't
seem
> to work.

> afterwards disk_size is always 33204512428815727 which isn't a correct
> result.

This number is "-1"  - DiskSize returns -1 if the drive number is invalid.

What you'll probably find is that you need to have a disk in the floppy
drive for this function to work and that you're testing it without one.

BTW - Are you trying to discover the capability of the FDD or the size of
the inserted media?

Nick

Other Threads