Hallo Engkin,
here is my error popup message...
it "crashes" at drive I (and then again at J, K, L what is my builtin cardreader). Unfortunately I also mentioned a wrong drive G and H that should not should not exist with getdir
The message (in German) is saying "no disc in drive".
This program is 32bit Free Pascal Windows - I just checked an older 16bit version virtual (Turbo Pascal), it simply ignores the I drive.
By the way. Can you please give an example of your functions?
"Diskfree uses GetDiskFreeSpaceExA or GetDiskFreeSpaceA"
I could not find in the Sysutils. Here is some from Stackoverflow... Okay I could use my "home" String then but Free Pascal Compiler already missing the
GetDiskFreeSpaceA in any typo tries....
program FreeDiskSpace;
{$APPTYPE CONSOLE}
uses
SysUtils;
const
Folder = 'C:\';
var
FreeAvailable, TotalSpace: Int64;
begin
(*GetDiskFreeSpaceA*)
if SysUtils.GetDiskFreeSpaceA(PChar(Folder), FreeAvailable, TotalSpace, nil) then begin
Writeln(TotalSpace div (1024*1024*1024), 'GB total');
Writeln(FreeAvailable div (1024*1024*1024), 'GB free');
end;
end.