Autor Beitrag
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: So 17.07.05 10:31 
hallo,

ich möchte die Größe eines bestimmten Ordner herrausfinden, nur hab ich keinen Ansatz, wie.
Die Forensuche ergab überraschender Weise auch kein Ergebnis.
Weis jemand ne Möglichkeit?

mfg


Moderiert von user profile iconGausi: Topic aus Windows API verschoben am So 17.07.2005 um 11:35
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: So 17.07.05 10:35 
Der Trick ist: nach Dateien suchen, und die Größen der gefundenen Dateien addieren. Du solltest das mal ansehen und entsprechend anpassen. Anstatt den Dateinamen in die Result-Liste zu übernehmen, einfach die Dateigröße draufaddieren.

_________________
We are, we were and will not be.
Fabian W. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: So 17.07.05 21:03 
Das mit dem dateinfinden hab ich schonmal gebraucht, schon n Armutszeugis, dass ich da net selber draug gekommen bin... *kopfschüttel*

Dateigröße:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
function GetFileSizeA(const FileName: String): Integer; 
var SR: TSearchRec; 
begin 
  Result := -1; 
   
  if FindFirst(FileName, faAnyFile and not faDirectory, SR) = 0 then 
  try  
    Result := SR.Size; 
  finally SysUtils.FindClose(SR) en

auch aus den FAQ'S. Ich versuchs mal.