home *** CD-ROM | disk | FTP | other *** search
- uses
- dos
-
- ;
-
-
-
- function __num(nr: longint):string;
- var temp: string;
- begin
- str(nr,temp); __num := temp;
- end;
-
-
-
- function __power(x,y: integer): longint;
- begin
- if x>0 then
- __power := round(exp(y*ln(x))) else if x<0 then
- __power := -1 * (y mod 2) * round(exp(y*ln(x)));
- end;
-
-
- function __streal(nr: real; decs: byte): string;
- var
- tm1, tm2 : string;
-
- begin
- tm1 := __num(trunc(nr));
- tm2 := __num(
- round(
- (
- nr - trunc(nr)
- )
- *
- __power(10, decs)
- )
- );
- __streal := tm1 + '.' + tm2;
- end;
-
-
-
- function __pntstr(n: longint): string;
- var
- tmpnrstr,
- tmpcvtstr : string;
- tab, i,
- len_numstr,
- len_pnts : longint;
-
- begin
- str(n, tmpnrstr); tab := 0;
- len_numstr := length(tmpnrstr);
- len_pnts := (len_numstr -1) div 3;
- tmpcvtstr[0] := chr(len_numstr + len_pnts);
-
- tmpcvtstr[len_pnts +len_numstr -tab] := tmpnrstr[len_numstr];
- for i := len_numstr-1 downto 1 do begin
- if ((len_numstr -i) mod 3 =0) then begin
- tmpcvtstr[len_pnts +i -tab] := '.'; inc(tab)
- end;
- tmpcvtstr[len_pnts +i -tab] := tmpnrstr[i];
- end;
- __pntstr := copy(tmpcvtstr, 1, len_numstr +len_pnts);
- end;
-
-
- var
- atri : searchrec;
- tot : real;
-
-
- begin
- tot := 0;
- findfirst('*.*', anyfile, atri);
- while doserror = 0 do begin
- tot := tot + atri.size;
- findnext(atri);
- end;
- write(' ');
- if trunc((tot / 1024) / 1024) > 0 then write(
- __streal(tot / 1024 / 1024, 1), ' Mb'
- ) else if (tot / 1024 > 0) then write(trunc(tot / 1024), ' Kb');
- writeln(' ', __pntstr(trunc(tot)));
- end.
-