[ reiser @ 16.08.2005. 05:37 ] @
Kako da odredim koliki je free/total prostor na nekoj particiji na hard disku ?
[ peromalosutra @ 16.08.2005. 13:06 ] @
Ako te zanima Pascal, onda u unitu dos imas funkciju Diskfree (oznaka:byte):longit, gdje je "oznaka" - oznaka particije i to tako da je
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!

[Ovu poruku je menjao peromalosutra dana 16.08.2005. u 14:09 GMT+1]

[Ovu poruku je menjao peromalosutra dana 16.08.2005. u 14:09 GMT+1]
[ Burgos @ 16.08.2005. 13:19 ] @
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;


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.
[ reiser @ 16.08.2005. 17:55 ] @
tenks :)