home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / PASSRC.ZIP / OT.PAS < prev    next >
Pascal/Delphi Source File  |  1991-02-04  |  22KB  |  557 lines

  1.                                      (* Chapter 16 - Program 9 *)
  2. program Oak_Tree;
  3.  
  4. (*                 XXX     X    X   X  XXXXX  XXXX   XXXXX  XXXXX
  5.   Feb 4, 1991     X   X   X X   X  X     X    X   X  X      X
  6.                   X   X  X   X  X X      X    X   X  X      X
  7.                   X   X  X   X  XX       X    XXXX   XXX    XXX
  8.                   X   X  XXXXX  X X      X    X X    X      X
  9.                   X   X  X   X  X  X     X    X  X   X      X
  10.                    XXX   X   X  X   X    X    X   X  XXXXX  XXXXX
  11. *)
  12.  
  13. uses Dos, Printer;
  14.  
  15. const  Page_Size = 66;
  16.        Max_Lines = 55;
  17.  
  18. type   Command_String = string[127];
  19.  
  20.        Output_Type = (Directories,Files);
  21.  
  22.        Dir_Rec     = ^Dirtree;    (* Dynamic storage for dir names *)
  23.        Dirtree     = record
  24.          Next      : Dir_Rec;
  25.          Dir_Name  : string[12];
  26.       end;
  27.  
  28.        Filerec     = ^Filetree;         (* Dynamic storage for the *)
  29.        Filetree    = record             (* filename sorting tree   *)
  30.          Left      : Filerec;
  31.          Right     : Filerec;
  32.          FileData  : SearchRec;                 (* From Dos module *)
  33.        end;
  34.  
  35. (*     type SearchRec = record                                     *)
  36. (*                        Fill : array[1..21] of byte;             *)
  37. (*                        Attr : byte;                             *)
  38. (*                        Time : longint;                          *)
  39. (*                        Size : longint;                          *)
  40. (*                        Name : string[12];                       *)
  41. (*                      end;                                       *)
  42.  
  43. var   File_Record    : SearchRec;      (* A working file record    *)
  44.       File_Point     : Filerec;        (* Pointer to a file record *)
  45.       Page_Number    : integer;
  46.       Line_Number    : integer;
  47.       Directory_Count : integer;
  48.       Recpack        : Registers;               (* From Dos module *)
  49.       File_Request   : string[25];
  50.       Root_Mask      : Command_String;(* Used for vol-label search *)
  51.       Starting_Path  : Command_String;
  52.  
  53.       Total_Clusters      : longint;
  54.       Disk_Total_Bytes    : longint;
  55.       Cluster_Size        : integer;
  56.       Sectors_Per_Cluster : integer;
  57.       Bytes_Per_Sector    : integer;
  58.       Free_Clusters       : longint;
  59.       Free_Bytes          : longint;
  60.       Total_Cbytes        : longint;
  61.       Total_Bytes         : longint;
  62.       All_Files           : integer;    (* Number of files on disk *)
  63.       Req_Files           : integer; (* Number of files in request *)
  64.  
  65.       Do_We_Print    : boolean;           (* Print or not          *)
  66.       Do_All_Stats   : boolean;           (* List all disk stats?  *)
  67.       No_Files_Out   : boolean;           (* List no files         *)
  68.       Date_Time_Rec  : DateTime;          (* From Dos module       *)
  69.  
  70. (* **************************************************** Initialize *)
  71. (* This procedure is used to initialize some variables and strings *)
  72. (* prior to starting the disk search.                              *)
  73. procedure Initialize;
  74. begin
  75.    Page_Number := 1;
  76.    Line_Number := 1;
  77.    Directory_Count := 0;
  78.    Total_Cbytes := 0;
  79.    Total_Bytes := 0;
  80.    All_Files := 0;
  81.    Req_Files := 0;
  82.    Root_Mask := 'C:\*.*';
  83.    Root_Mask[Length(Root_Mask) + 1] := Chr(0);
  84.                            (* Get the current default drive letter *)
  85.    Recpack.AX := $1900;
  86.    Intr($21,Recpack);
  87.    Root_Mask[1] := Chr(Recpack.AX and $F + Ord('A'));
  88. end;
  89.  
  90. (* ****************************** Read And Parse Command Arguments *)
  91. (* This procedure reads in the command line arguments, parses them,*)
  92. (* and sets up the switches and defaults for the disk searches.    *)
  93. procedure Read_And_Parse_Command_Arguments;
  94. var    Parameters         : Command_String;
  95.        Index              : byte;
  96. begin
  97.    Do_We_Print := FALSE;
  98.    Do_All_Stats := FALSE;
  99.    No_Files_Out := FALSE;
  100.    File_Request := '*.*';
  101.  
  102.    for Index := 1 to ParamCount do begin
  103.       Parameters := ParamStr(Index);
  104.                                      (* Find command line switches *)
  105.       if Parameters[1] = '/' then begin
  106.          if Upcase(Parameters[2]) = 'P' then Do_We_Print := TRUE;
  107.          if Upcase(Parameters[2]) = 'N' then No_Files_Out := TRUE;
  108.          if Upcase(Parameters[2]) = 'S' then Do_All_Stats := TRUE;
  109.       end
  110.       else begin                   (* Find designated drive letter *)
  111.          if Parameters[2] = ':' then begin
  112.             Root_Mask[1] := Parameters[1];
  113.             Delete(Parameters,1,2);
  114.          end;
  115.  
  116.          if Parameters = '' then              (* No filename given *)
  117.             File_Request := '*.*'
  118.          else                                   (* Filename listed *)
  119.             File_Request := Parameters;
  120.       end;
  121.    end;
  122.                      (* get the current path on the selected drive *)
  123.    Getdir(Ord(Root_Mask[1])-Ord('A') + 1,Starting_Path);
  124.    if Length(Starting_Path) > 3 then
  125.       Starting_Path := Starting_Path + '\';
  126.  
  127. end;
  128.  
  129. (* ********************************************* count print lines *)
  130. procedure Count_Print_Lines(Line_Count : byte);
  131. var Count : byte;
  132. begin
  133.    if Do_We_Print then begin
  134.       if Line_Count > 250 then (* This signals the end of the tree *)
  135.       begin                    (* Space up to a new page           *)
  136.          Writeln(Lst,Char(12));
  137.          Line_Number := 1;
  138.          Line_Count := 0;
  139.       end;
  140.       Line_Number := Line_Number + Line_Count;
  141.       if Line_Number > Max_Lines then begin
  142.          Page_Number := Page_Number +1;
  143.          Writeln(Lst,Char(12));                (* Go to a new page *)
  144.          Writeln(Lst);                       (* Move down one line *)
  145.          Writeln(Lst,'Page':60,
  146.                                                Page_Number:4);
  147.          Writeln(Lst);
  148.          Line_Number := 1;
  149.       end;
  150.    end;
  151. end;
  152.  
  153. (* ************************************************** Print Header *)
  154. (* In this section of code, the volume label is found and displayed*)
  155. (* and the present time and date are determined and displayed.     *)
  156. procedure Print_Header;
  157. var Year,Month,Day,DayOfWeek  : word;
  158.     Hour,Minute,Second,Sec100 : word;
  159.     Index                 : integer;
  160. begin
  161.    if Do_We_Print then begin
  162.       Writeln(Lst);
  163.       Write(Lst,'          Directory for ');
  164.    end;
  165.    Write('          Directory for ');
  166. {  Recpack.AX := $1A00;                          (* Set up the DTA *)
  167.    Recpack.DS := Seg(Dta);
  168.    Recpack.DX := Ofs(Dta);
  169.    Msdos(Recpack);                           (* DTA setup complete *)
  170.    Error := Recpack.AX and $FF;
  171.    if Error > 0 then Writeln('DTA setup error ',Error);
  172.  }
  173.    FindFirst(Root_Mask,$08,File_Record);      (* Get the volume ID *)
  174.    if ((DosError > 0) or (File_Record.Attr <> 8)) then begin
  175.       if Do_We_Print then
  176.          Write(Lst,' <no vol label> ');
  177.       Write(' <no vol label> ');
  178.    end
  179.    else begin                            (* Write out Volume Label *)
  180.       if Do_we_Print then
  181.          Write(Lst,File_Record.Name);
  182.       Write(File_Record.Name);
  183.    end;
  184.  
  185.    GetDate(Year,Month,Day,DayOfWeek);      (* Get the present date *)
  186.    GetTime(Hour,Minute,Second,Sec100);     (* Get the present time *)
  187.    Write('             ');
  188.    Write(Month,'/',Day,'/',Year);
  189.    Writeln('    ',Hour,':',Minute);
  190.    Writeln;
  191.    if Do_We_Print then begin
  192.       Write(Lst,'             ');
  193.       Write(Lst,Month,'/',Day,'/',Year);
  194.       Writeln(Lst,'    ',Hour,':',Minute);
  195.       Writeln(Lst);
  196.       Count_Print_Lines(2);
  197.    end;
  198.                                   (* get all of the disk constants *)
  199.    Recpack.AX := $3600;
  200.    Recpack.DX := (Ord(Root_Mask[1]) - 64) and $F;
  201.    Msdos(Recpack);
  202.    Sectors_Per_Cluster := Recpack.AX;
  203.    Free_Clusters := Recpack.BX;
  204.    Bytes_Per_Sector := Recpack.CX;
  205.    Total_Clusters := Recpack.DX;
  206.  
  207.    Cluster_Size := Bytes_Per_Sector * Sectors_Per_Cluster;
  208.  
  209.    if Do_All_Stats then begin (* Print out disk stats if asked for *)
  210.       Write('             bytes/sector =',Bytes_Per_Sector:6);
  211.       Disk_Total_Bytes := Total_Clusters * Cluster_Size;
  212.       Writeln('       total disk space =',Disk_Total_Bytes:12);
  213.       Write('            bytes/cluster =',Cluster_Size:6);
  214.       Free_Bytes := Free_Clusters * Cluster_Size;
  215.       Writeln('        free disk space =',Free_Bytes:12);
  216.       Writeln;
  217.       if Do_We_Print then begin
  218.          Write(Lst,'             bytes/sector =',Bytes_Per_Sector:6);
  219.          Writeln(Lst,'       total disk space =',
  220.                                              Disk_Total_Bytes:12);
  221.          Write(Lst,'            bytes/cluster =',Cluster_Size:6);
  222.          Writeln(Lst,'        free disk space =',Free_Bytes:12);
  223.          Writeln(Lst);
  224.          Count_Print_Lines(3);
  225.       end;
  226.    end;
  227. end;
  228.  
  229.  
  230. (* *************************************** Position a new filename *)
  231. (* When a new filename is found, this routine is used to locate it *)
  232. (* in the B-TREE that will be used to sort the filenames alphabet- *)
  233. (* ically.                                                         *)
  234. procedure Position_A_New_Filename(Root, New : Filerec);
  235. var    Index   : integer;
  236.        Done    : boolean;
  237. begin
  238.    Index := 1;
  239.    Done := FALSE;
  240.    repeat
  241.       if New^.FileData.Name < Root^.FileData.Name then begin
  242.          Done := TRUE;
  243.          if Root^.Left = nil then Root^.Left := New
  244.          else
  245.             Position_A_New_Filename(Root^.Left,New);
  246.       end
  247.       else if New^.FileData.Name > Root^.FileData.Name then
  248.       begin
  249.          Done := TRUE;
  250.          if Root^.Right = nil then
  251.             Root^.Right := New
  252.          else
  253.             Position_A_New_Filename(Root^.Right,New);
  254.       end;
  255.       Index := Index +1;
  256.    until (Index = 13) or Done;
  257. end;
  258.  
  259.  
  260. (* ************************************************** Print a file *)
  261. (* This is used to print the data for one complete file.  It is    *)
  262. (* called with a pointer to the root and an attribute that is to be*)
  263. (* printed.  Either the directories are printed (attribute = $10), *)
  264. (* or the files are printed.                                       *)
  265. procedure Print_A_File(Root : Filerec;
  266.                        Which_List : Output_Type);
  267. var Index,Temp  : byte;
  268. begin
  269.    Temp := Root^.FileData.Attr;
  270.    if ((Temp =  $10) and (Which_List = Directories)) or
  271.                  ((Temp <> $10) and (Which_List = Files)) then begin
  272.       Write('                ');
  273.       case Temp of
  274.          $27 : Write('<HID>  ');
  275.          $10 : Write('<DIR>  ');
  276.          $20 : Write('       ')
  277.          else  Write('<',Temp:3,'>  ');
  278.       end;   (* of case *)
  279.       if Do_We_Print then begin
  280.          Write(Lst,'                ');
  281.          case Temp of
  282.             $27 : Write(Lst,'<HID>  ');
  283.             $10 : Write(Lst,'<DIR>  ');
  284.             $20 : Write(Lst,'       ')
  285.             else  Write(Lst,'<',Temp:3,'>  ');
  286.          end;   (* of case *)
  287.       end;
  288.                                          (* Write out the filename *)
  289.       Write(Root^.FileData.Name);
  290.       for Index := 1 to (15 - Length(Root^.FileData.Name)) do
  291.          Write(' ');
  292.       if Do_We_Print then begin
  293.          Write(Lst,Root^.FileData.Name);
  294.          for Index := 1 to (15 - Length(Root^.FileData.Name)) do
  295.             Write(Lst,' ');
  296.       end;
  297.                                         (* Write out the file size *)
  298.       Write(Root^.FileData.Size:9);
  299.       if Do_We_Print then
  300.          Write(Lst,Root^.FileData.Size:9);
  301.                                (* Write out the file date and time *)
  302.       UnpackTime(Root^.FileData.Time, Date_Time_Rec);
  303.       Write('   ',Date_Time_Rec.Month:2,'/');
  304.       Write(Date_Time_Rec.Day:2,'/');
  305.       Write(Date_Time_Rec.Year,'   ');
  306.       Write('  ',Date_Time_Rec.Hour:2,':');
  307.       Writeln(Date_Time_Rec.Min:2);
  308.       if Do_We_Print then begin
  309.          Write(Lst,'   ',Date_Time_Rec.Month:2,'/');
  310.          Write(Lst,Date_Time_Rec.Day:2,'/');
  311.          Write(Lst,Date_Time_Rec.Year,'   ');
  312.          Write(Lst,'  ',Date_Time_Rec.Hour:2,':');
  313.          Writeln(Lst,Date_Time_Rec.Min:2);
  314.          Count_Print_Lines(1);
  315.       end;
  316.    end;
  317. end;
  318.  
  319. (* ********************************************* Print a directory *)
  320. (* This is a recursive routine to print out the filenames in alpha-*)
  321. (* betical order.  It uses a B-TREE with "infix" notation.  The    *)
  322. (* actual printing logic was removed to another procedure so that  *)
  323. (* the recursive part of the routine would not be too large and    *)
  324. (* fill up the heap too fast.                                      *)
  325. procedure Print_A_Directory(Root         : Filerec;
  326.                             Which_List   : Output_Type);
  327. begin
  328.    if Root^.Left <> nil then
  329.       Print_A_Directory(Root^.Left,Which_List);
  330.  
  331.    Print_A_File(Root,Which_List);        (* Write out the filename *)
  332.  
  333.    if Root^.Right <> nil then
  334.       Print_A_Directory(Root^.Right,Which_List);
  335. end;
  336.  
  337. (* **************************************************** Erase tree *)
  338. (* After the directory is printed and counted, it must be erased or*)
  339. (* the "heap" may overflow for a large disk with a lot of files.   *)
  340. procedure Erase_Tree(Root : Filerec);
  341. begin
  342.    if Root^.Left  <> nil then Erase_Tree(Root^.Left);
  343.    if Root^.Right <> nil then Erase_Tree(Root^.Right);
  344.    Dispose(Root);
  345. end;
  346.  
  347. (* ************************************************ Do A Directory *)
  348. (* This procedure reads all entries in any directory and sorts the *)
  349. (* filenames alphabetically.  Then it prints out the complete stat-*)
  350. (* istics, and calls itself to do all of the same things for each  *)
  351. (* of its own subdirectories.  Since each subdirectory also calls  *)
  352. (* each of its subdirectories, the recursion continues until there *)
  353. (* are no more subdirectories.                                     *)
  354. procedure Do_A_Directory(Input_Mask : Command_String);
  355. var   Mask          : Command_String;
  356.       Count,Index   : integer;
  357.       Cluster_Count : longint;
  358.       Cluster_Bytes : longint;
  359.       Byte_Count    : longint;
  360.       Tree_Root     : Filerec;                (* Root of file tree *)
  361.       Dir_Root      : Dir_Rec;
  362.       Dir_Point     : Dir_Rec;
  363.       Dir_Last      : Dir_Rec;
  364.       File_Record   : SearchRec;
  365.  
  366.     (* This embedded procedure is called upon to store all of the  *)
  367.     (* directory names in a linear linked list rather than a       *)
  368.     (* B-TREE since it should be rather short and efficiency of    *)
  369.     (* sorting is not an issue.  A bubble sort will be used on it. *)
  370.     procedure Store_Dir_Name;
  371.     begin
  372.        if File_Record.Attr = $10 then begin (* Pick out directories*)
  373.                     (* Directory name found, ignore if it is a '.' *)
  374.           if File_Record.Name[1] <> '.' then begin
  375.              New(Dir_Point);
  376.              Dir_Point^.Dir_Name := File_Record.Name;
  377.              Dir_Point^.Next := nil;
  378.              if Dir_Root = nil then
  379.                 Dir_Root := Dir_Point
  380.              else
  381.                 Dir_Last^.Next := Dir_Point;
  382.              Dir_Last := Dir_Point;
  383.           end;
  384.        end;
  385.     end;
  386.  
  387.      (* This is the procedure that sorts the directory names after *)
  388.      (* they are all accumulated.  It uses a bubble sort technique *)
  389.      (* which is probably the most inefficient sort available.  It *)
  390.      (* is perfectly acceptable for what is expected to be a very  *)
  391.      (* short list each time it is called.  More than 30 or 40     *)
  392.      (* subdirectories in one directory would not be good practice *)
  393.      (* but this routine would sort any number given to it.        *)
  394.      procedure Sort_Dir_Names;
  395.      var Change      : byte;
  396.          Save_String : string[15];
  397.          Dir_Next    : Dir_Rec;
  398.      begin
  399.         repeat
  400.            Change := 0;
  401.            Dir_Point := Dir_Root;
  402.            while Dir_Point^.Next <> nil do
  403.               begin
  404.               Dir_Next := Dir_Point^.Next;
  405.               Save_String := Dir_Next^.Dir_Name;
  406.               if Save_String < Dir_Point^.Dir_Name then begin
  407.                  Dir_Next^.Dir_Name := Dir_Point^.Dir_Name;
  408.                  Dir_Point^.Dir_Name := Save_String;
  409.                  Change := 1;
  410.               end;
  411.               Dir_Point := Dir_Point^.Next;
  412.            end;
  413.         until Change = 0;    (* No swaps in this pass, we are done *)
  414.      end;
  415.  
  416. begin (* Do_A_Directory procedure *)
  417.    Count := 0;
  418.    Cluster_Count := 0;
  419.    Dir_Root := nil;
  420.    Mask := Input_Mask + '*.*';
  421.    Mask[Length(Mask) + 1] := Chr(0);    (* A trailing zero for DOS *)
  422.                                    (* Count all files and clusters *)
  423.    repeat
  424.       if Count = 0 then               (* Get first directory entry *)
  425.          FindFirst(Mask,$17,File_Record)
  426.       else                     (* Get additional directory entries *)
  427.          FindNext(File_Record);
  428.       if DosError = 0 then begin       (* A good filename is found *)
  429.          Count := Count +1;            (* Add one for a good entry *)
  430.  
  431.                            (* Count up the number of clusters used *)
  432.          Index := File_Record.Size div Cluster_size;
  433.          if File_Record.Size mod Cluster_Size > 0 then
  434.             Index := Index + 1;            (* If a fractional part *)
  435.          Cluster_Count := Cluster_Count + Index;
  436.          if Index = 0 then     (* This is a directory, one cluster *)
  437.             Cluster_Count := Cluster_Count + 1;
  438.          Store_Dir_Name;
  439.       end;
  440.    until DosError > 0;
  441.    Cluster_Bytes := Cluster_Count * Cluster_Size;
  442.    Directory_Count := Directory_Count + 1;
  443.    Write('    ',Directory_Count:3,'. ');
  444.    Write(Input_Mask);
  445.    for Index := 1 to (32 - Length(Input_Mask)) do Write(' ');
  446.    Writeln(Count:4,' Files  Cbytes =',Cluster_Bytes:9);
  447.    if Do_We_Print then begin
  448.       Write(Lst,'    ',Directory_Count:3,'. ');
  449.       Write(Lst,Input_Mask);
  450.       for Index := 1 to (32 - Length(Input_Mask)) do Write(Lst,' ');
  451.       Writeln(Lst,Count:4,' Files  Cbytes =',Cluster_Bytes:9);
  452.       Count_Print_Lines(1);
  453.    end;
  454.    Total_Cbytes := Total_Cbytes + Cluster_Bytes;
  455.    All_Files := All_Files + Count;
  456.  
  457.                            (* files counted and clusters counted   *)
  458.                            (* Now read in only the requested files *)
  459.  
  460.    Count := 0;
  461.    Byte_Count := 0;
  462.    Tree_Root := nil;
  463.    if No_Files_Out <> TRUE then begin
  464.       Mask := Input_Mask + File_Request;
  465.       Mask[Length(Mask) + 1] := Chr(0); (* A trailing zero for DOS *)
  466.       repeat
  467.          New(File_Point);
  468.          if Count = 0 then            (* Get first directory entry *)
  469.             FindFirst(Mask,$17,File_Record)
  470.          else                  (* Get additional directory entries *)
  471.             FindNext(File_Record);
  472.          if DosError = 0 then begin    (* A good filename is found *)
  473.             Count := Count +1;         (* Add one for a good entry *)
  474.             File_Point^.Left := nil;
  475.             File_Point^.Right := nil;
  476.             File_Point^.FileData := File_Record;
  477.             if Tree_Root = nil then begin (* Pt to 1st elem in tree*)
  478.                Tree_Root := File_Point;
  479.             end
  480.             else begin     (* Point to additional elements in tree *)
  481.                Position_A_New_Filename(Tree_Root,File_Point);
  482.             end;
  483.  
  484.             Byte_Count := Byte_Count + File_Record.Size;
  485.          end;
  486.       until DosError > 0;
  487.    end;
  488.  
  489.    if Tree_Root <> nil then
  490.       Print_A_Directory(Tree_Root,Directories);
  491.    if Tree_Root <> nil then
  492.       Print_A_Directory(Tree_Root,Files);
  493.    if Count > 0 then begin
  494.       Writeln('                  ',Count:5,' Files ',
  495.                                  Byte_Count:17,' Bytes');
  496.       Writeln;
  497.       if Do_We_Print then begin
  498.          Writeln(Lst,'                  ',Count:5,' Files ',
  499.                                     Byte_Count:17,' Bytes');
  500.          Writeln(Lst);
  501.          Count_Print_Lines(2);
  502.       end;
  503.       Total_Bytes := Total_Bytes + Byte_Count;
  504.       Req_Files := Req_Files + Count;
  505.    end;
  506.                             (* Now go do all of the subdirectories *)
  507.    if Dir_Root <> nil then Sort_Dir_Names;
  508.    Dir_Point := Dir_Root;
  509.    while Dir_Point <> nil do begin
  510.       Mask := Input_Mask + Dir_Point^.Dir_Name + '\';
  511.       Do_A_Directory(Mask);
  512.       Dir_Point := Dir_Point^.Next;
  513.    end;
  514.                            (* Finally, erase the tree and the list *)
  515.    if Tree_Root <> nil then
  516.       Erase_Tree(Tree_Root);
  517.  
  518.    while Dir_Root <> nil do begin
  519.       Dir_Point := Dir_Root^.Next;
  520.       Dispose(Dir_Root);
  521.       Dir_Root := Dir_Point;
  522.    end;
  523. end;
  524.  
  525. (* ******************************************* Output Summary Data *)
  526. procedure Output_Summary_Data;
  527.  
  528. begin
  529.    Writeln;
  530.    Write('                     ',Req_Files:5,' Files');
  531.    Writeln(Total_Bytes:15,' Bytes in request');
  532.    Write('                     ',All_Files:5,' Files');
  533.    Writeln(Total_Cbytes:15,' Cbytes in tree');
  534.    Write('                                   ');
  535.    Free_Bytes := Free_Clusters * Cluster_Size;
  536.    Writeln(Free_Bytes:12,' Bytes free on disk');
  537.    if Do_We_Print then begin
  538.       Writeln(Lst);
  539.       Write(Lst,'                     ',Req_Files:5,' Files');
  540.       Writeln(Lst,Total_Bytes:15,' Bytes in request');
  541.       Write(Lst,'                     ',All_Files:5,' Files');
  542.       Writeln(Lst,Total_Cbytes:15,' Cbytes in tree');
  543.       Write(Lst,'                                   ');
  544.       Writeln(Lst,Free_Bytes:12,' Bytes free on disk');
  545.       Count_Print_Lines(4);      (* Signal the end, space paper up *)
  546.    end;
  547. end;
  548.  
  549. begin  (* Main program - Oak Tree ******************************** *)
  550.    Initialize;
  551.    Read_And_Parse_Command_Arguments;
  552.    Print_Header;
  553.    Do_A_Directory(Starting_Path);
  554.    Output_Summary_Data;
  555.    Count_Print_Lines(255);
  556. end.  (* Main Program *)
  557.