AddDisk behaves like a procedure, not a function
Original Reporter info from Mantis: crlab @neurolabusc1
-
Reporter name: Chris Rorden
Original Reporter info from Mantis: crlab @neurolabusc1
- Reporter name: Chris Rorden
Description:
Hello-
I would like to determine the amount of free space on a Linux file system. The AddDisk function in Freepascal should let me set a number for a drive path.
http://rush3d.com/reference/freepascal-1.00/units/node21.html#SECTION002151000000000000000
However, while I can call AddDisk from Linux, the compiler will not allow me to get a result from the function AddDisk. In other words, I can call
AddDisk(DriveStr);
but not
lInteger := AddDisk(DriveStr);
The latter method is more elegant, as it is easy to determine which value should be passed to the DiskFree procedure. Not sure if this is a Lazarus or Freepascal issue...
Steps to reproduce:
function DiskFreeEx (DriveStr: String): Int64;
var
lOutDisk: Integer;
begin
lOutDisk := AddDisk(DriveStr);
result := DiskFree(lOutDisk);
end;
Mantis conversion info:
- Mantis ID: 2018
- OS: SUSE Linux
- OS Build: 10.0
- Platform: x86
- Version: 0.9.15 (SVN)