Kako da odredim koliki je free/total prostor na nekoj particiji na hard disku ?
Prostor na particijama
Zaključano
Zakačeno
izmenjeno 2 puta, poslednji put peromalosutra 16.08.2005. u 14:09
Izmene poruke
- peromalosutra16.08.2005. u 14:09zapis iz teksta poruke
- peromalosutra16.08.2005. u 14:09zapis iz teksta poruke
Ako te zanima Pascal, onda u unitu dos imas funkciju Diskfree (oznaka:byte):longit, gdje je "oznaka" - oznaka particije i to tako da je
0 Default drive
1 Drive A
2 Drive B
3 Drive C
Rezultat dobisaš u longint-u.
A ako pitaš za Delphi... onda nemam pojma!
Citat:
0 Default drive
1 Drive A
2 Drive B
3 Drive C
Rezultat dobisaš u longint-u.
A ako pitaš za Delphi... onda nemam pojma!
I u Delphiju postoji ta funkcija:
Code:
var
S: string;
AmtFree: Int64;
Total: Int64;
begin
AmtFree := DiskFree(0);
Total := DiskSize(0);
S := IntToStr(AmtFree div Total) + 'percent of the space on drive 0 is free: ' (AmtFree div 1024) + ' Kbytes free. ';
Label1.Caption := S;
end;
var
S: string;
AmtFree: Int64;
Total: Int64;
begin
AmtFree := DiskFree(0);
Total := DiskSize(0);
S := IntToStr(AmtFree div Total) + 'percent of the space on drive 0 is free: ' (AmtFree div 1024) + ' Kbytes free. ';
Label1.Caption := S;
end;
Citat:
Returns the number of free bytes on a specified drive.
Unit
SysUtils
Category
file management routines
Delphi syntax:
function DiskFree(Drive: Byte): Int64;
C++ syntax:
extern PACKAGE __int64 __fastcall DiskFree(Byte Drive);
Description
DiskFree returns the number of free bytes on the specified drive, where 0 = Current, 1 = A, 2 = B, and so on.
DiskFree returns -1 if the drive number is invalid.
Note: DiskFree is only available on Windows.
Unit
SysUtils
Category
file management routines
Delphi syntax:
function DiskFree(Drive: Byte): Int64;
C++ syntax:
extern PACKAGE __int64 __fastcall DiskFree(Byte Drive);
Description
DiskFree returns the number of free bytes on the specified drive, where 0 = Current, 1 = A, 2 = B, and so on.
DiskFree returns -1 if the drive number is invalid.
Note: DiskFree is only available on Windows.
tenks :)