From: "Simon Patterson" Subject: Re: Getting the size of a directory/folder? Date: 08 May 1999 00:00:00 GMT Message-ID: <7h2f87$50v$1@news6.svr.pol.co.uk> References: <7h28ar$257s$1@news.gate.net> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Complaints-To: abuse@theplanet.net X-Trace: news6.svr.pol.co.uk 926203975 5151 62.136.16.221 (8 May 1999 22:52:55 GMT) Organization: Customer of Planet Online X-MSMail-Priority: Normal NNTP-Posting-Date: 8 May 1999 22:52:55 GMT Newsgroups: comp.lang.pascal.delphi.misc Hi Ross, Try using this function. It returns a record of type TDirInfo. Declare a variable of this type and use it like this. variable := DirInfo(DirName, RecurseSubDirectories); Then query the variable identifiers: number of files in directory(s) := variable.files number of directories := variable.dirs total size of all files in directory(s) := variable.size type TDirInfo = record files: Integer; dirs: Integer; size: Integer; end; function DirInfo(const Dirname: TFilename; Subs: Boolean): TDirInfo; var rec: TSearchRec; code: Integer; begin with Result do begin files := 0; dirs := 0; size := 0; end; code := FindFirst(Dirname + '\*.*', faAnyfile and not faVolumeID, rec); while code = 0 do begin Inc(Result.size, rec.size); if ((rec.attr and faDirectory) <> 0) then begin if (rec.name[1] <> '.') then begin Inc(Result.dirs); if Subs then with DirInfo(Dirname + '\' + rec.name, True), Result do begin Inc(files, files); Inc(dirs, dirs); Inc(size, size); end; end; end else Inc(Result.files); code := FindNext(rec); end; end; Hope this is of some help Simon Patterson Ross Elliott wrote in message news:7h28ar$257s$1@news.gate.net... > Hey all, > I was wondering if someone could point me to the function call that will be > able to tell me how big a directory/folder is. I've searched through the > Help files and so far have come up empty. Any help would appreciated. > > -Ross Elliott