home *** CD-ROM | disk | FTP | other *** search
/ Power Utilities / Power Utilities.iso / utility / pro209 / ds.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-04-07  |  19.0 KB  |  606 lines

  1. /* Created using Turbo C - Copyright (C) Borland 1987,1988 */
  2. /*-------------------------------------------------------------------------
  3.  
  4. DS - Directory Size. Written by Aaron Bredon.    Version 4.5
  5.  
  6.     This program reports the amount of space taken up by a directory's files
  7.         (including subdirectories).
  8.     It will not include the space taken up by the directory itself.
  9.  
  10.         It could be off by a couple of clusters
  11.             from what CHKDSK reports (total of hidden,directories, & files).
  12.             I think this is caused by unused blocks being marked used
  13.             in the FAT.
  14.  
  15. Usage:  ds [-abcdfhinoprsxz | q[nn] | l[nnnn] ... ] [pathname ]
  16.         where:
  17.     -a : Show files in directory                    (Toggle - default:OFF)
  18.     -b : Show attribute instead of time             (Toggle - default:OFF)
  19.     -c : Show sizes in clusters                     (Toggle - default:OFF)
  20.     -d : Split screen                               (Toggle - default:OFF)
  21.     -f : Base on file size, not disk space          (Toggle - default:OFF)
  22.     -h : Count Hidden and System files              (Toggle - default:ON)
  23.     -i : Include space occupied by subdirectories   (Toggle - default:ON)
  24.     -lnnnn : Force cluster size to be nnnn bytes.
  25.              nnnn = 0 uses actual cluster size.
  26.     -n : Show full pathname                         (Toggle - default:OFF)
  27.     -o : Show path & size only                      (Toggle - default:OFF)
  28.     -p : Paged listing                              (Toggle - default:OFF)
  29.     -qnn : use nn lines per page before pausing.    (default:25)
  30.     -r : Recursive calls for subdirectory size      (Toggle - default:ON)
  31.     -s : Summary information only                   (Toggle - default:ON)
  32.     -x : Show info on current directory             (Toggle - default:OFF)
  33.     -z : Show total statistics                      (Toggle - default:ON)
  34. The default pathname is the current directory on the current drive.
  35.  
  36. --------------------------------------------------------------------------*/
  37.  
  38.  
  39. #include <stdio.h>
  40. #include <stdlib.h>
  41. #include <dir.h>
  42. #include <dos.h>
  43. #include <string.h>
  44. #include <ctype.h>
  45. #include <conio.h>
  46.  
  47. #define MAXDIRS 10
  48. void parspath(char * path);            /* takes a pathname and changes it to
  49.                                         a full pathname */
  50.  
  51. int EGA;
  52. int maxlines_printed;
  53. int xx;        /* debugging var*/
  54. char copmes[] = "Created using Turbo C - Copyright (C) Borland 1987,1988";
  55. char drive[MAXDRIVE], dir[MAXDIR], filename[MAXFILE], ext[MAXEXT];
  56. char mask[(MAXFILE+MAXEXT)];
  57. unsigned char udrive = 0;
  58. int dir_specified = 0,    show_sub = 0,        /* flags for options */
  59.     show_files = 0,        traverse_sub = 1,
  60.     total_stats = 1,    show_cluster = 0,
  61.     show_hidden = 1,    force_cluster = 0,
  62.     file_size = 0,        curr_dir = 0,
  63.     split_screen = 0,    paged_list = 0,
  64.     dir_space = 1,        show_attrib = 0,
  65.     show_path = 0,        path_only = 0;
  66. int cluster_size = 0;
  67. int first_column = 1;                       /* toggle for split-screen */
  68. int lines_printed = 0;                        /* count for paged listing */
  69. struct dfree dinfo;                            /* used by getdfree */
  70. char searchdir[81], buf[81];                /* used by main & process_dir */
  71. char temparg[MAXDIRS][81];
  72.  
  73. union fdte{
  74.     struct {
  75.         unsigned dy:5;
  76.         unsigned mn:4;
  77.         unsigned yr:7;
  78.     }fd;
  79.     unsigned us;
  80. };
  81. union ftme{
  82.     struct {
  83.         unsigned :5;
  84.         unsigned mn:6;
  85.         unsigned hr:5;
  86.     }ft;
  87.     unsigned us;
  88. };
  89.  
  90. void usage(void)                        /* produces usage output */
  91. {
  92.     printf("DS - Directory Size - Version 4.5\n");
  93.     printf("Usage:  ds [-abcdfhinoprsxz | q[nn] | l[nnnn] ... ] [pathname ]\n");
  94.     printf("        where:\n");
  95.     printf("    -a : Show files in directory                    (Toggle - default:OFF)\n");
  96.     printf("    -b : Show attribute instead of time             (Toggle - default:OFF)\n");
  97.     printf("    -c : Show sizes in clusters                     (Toggle - default:OFF)\n");
  98.     printf("    -d : Split screen                               (Toggle - default:OFF)\n");
  99.     printf("    -f : Base on file size, not disk space          (Toggle - default:OFF)\n");
  100.     printf("    -h : Count Hidden and System files              (Toggle - default:ON)\n");
  101.     printf("    -i : Include space occupied by subdirectories   (Toggle - default:ON)\n");
  102.     printf("    -lnnnn : Force cluster size to be nnnn bytes.\n");
  103.     printf("             nnnn = 0 uses actual cluster size.\n");
  104.     printf("    -n : Show full pathname                         (Toggle - default:OFF)\n");
  105.     printf("    -o : Show path & size only                      (Toggle - default:OFF)\n");
  106.     printf("    -p : Paged listing                              (Toggle - default:OFF)\n");
  107.     printf("    -qnn : use nn lines per page before pausing.    (default:25)\n");
  108.     printf("    -r : Recursive calls for subdirectory size      (Toggle - default:ON)\n");
  109.     printf("    -s : Summary information only                   (Toggle - default:ON)\n");
  110.     printf("    -x : Show info on current directory             (Toggle - default:OFF)\n");
  111.     printf("    -z : Show total statistics                      (Toggle - default:ON)\n");
  112.     printf("The default pathname is the current directory on the current drive.\n");
  113.     printf("    NOTE: This program is very occasionally not quite 100% accurate.\n");
  114. }
  115.  
  116. void path_only_output(struct ffblk * data1,long int number,char * path1)
  117. {
  118.     char num[20]="";
  119.     char oldnum[20]="";
  120.     register int x;
  121.     char dc;
  122.     char tempstr[81];
  123.  
  124.  
  125.     dc=((data1->ff_attrib)&FA_DIREC)?'\\':' ';
  126.     ltoa( number, oldnum, 10 );            /* get number as a string */
  127.     x = ( strlen(oldnum) % 3 );            /* find # of digits in first group */
  128.     if (x == 0) x = 3;
  129.     strncpy(num, oldnum, x);            /* move first group */
  130.     while ( x < strlen(oldnum) )        /* move rest of number */
  131.     {
  132.         strcat(num,",");                /* add comma */
  133.         strncat(num, oldnum+x, 3);        /* move next group */
  134.         x+=3;                            /* update x */
  135.     }
  136.     strcpy(tempstr,path1);
  137.     strcat(tempstr,data1->ff_name);
  138.     printf("%15s   %-21s%c",num,tempstr,dc);
  139.  
  140.     if ( split_screen && first_column )    /* handle split-screen output */
  141.     {
  142.         printf("│");
  143.         first_column = 0;
  144.     }
  145.     else
  146.     {
  147.         printf("\n");
  148.         lines_printed++;
  149.         if ( paged_list && ( lines_printed > (maxlines_printed-3) ) )
  150.         {                                /* handle paged listing */
  151.             register int i;
  152.  
  153.             printf("%62s","========== hit any key to continue ==========");
  154.             getch();                    /* wait for key */
  155.             for(i=0;i<62;i++) printf("\b \b");
  156.             lines_printed = 0;            /* reset counter */
  157.         }
  158.         first_column = 1;
  159.     }
  160. }
  161.  
  162. void normal_output(struct ffblk * data1,long int number)
  163.                                         /* xchar is used to identify dir's */
  164. {                                        /* outputs info with commas */
  165.     char * extbeg;
  166.     char num[20]="";                    /* number with commas */
  167.     char oldnum[20]="";                    /* number without commas */
  168.     register int x;                                /* # digits written */
  169.     int namelen;
  170.     char dc;
  171.     char tc;
  172.     union ftme ft;
  173.     union fdte fd;
  174.     int day,mon,yr,hour,min;
  175.  
  176.     fd.us=data1->ff_fdate;
  177.     ft.us=data1->ff_ftime;
  178.     day=fd.fd.dy;
  179.     mon=fd.fd.mn;
  180.     yr=fd.fd.yr+80;
  181.     while (yr>99) yr-=100;
  182.     hour=(ft.ft.hr)%12;
  183.     if (hour==0) hour=12;
  184.     tc=((ft.ft.hr)/12)?'p':'a';
  185.     min=ft.ft.mn;
  186.     extbeg=strchr(data1->ff_name,'.')+1;
  187.     namelen=(extbeg-data1->ff_name)-1;
  188.     if (namelen>9) {
  189.         extbeg=data1->ff_name+strlen(data1->ff_name);
  190.         namelen=(extbeg-data1->ff_name);
  191.     }
  192.     dc=((data1->ff_attrib)&FA_DIREC)?'\\':' ';
  193.     ltoa( number, oldnum, 10 );            /* get number as a string */
  194.     x = ( strlen(oldnum) % 3 );            /* find # of digits in first group */
  195.     if (x == 0) x = 3;
  196.     strncpy(num, oldnum, x);            /* move first group */
  197.     while ( x < strlen(oldnum) )        /* move rest of number */
  198.     {
  199.         strcat(num,",");                /* add comma */
  200.         strncat(num, oldnum+x, 3);        /* move next group */
  201.         x+=3;                            /* update x */
  202.     }
  203.     printf("%-8.*s.%-3.3s%c",namelen,data1->ff_name,extbeg,dc);
  204.     printf("%10s",num);
  205.     printf(" %2d-%02d-%02d",mon,day,yr);
  206.  
  207.     if (show_attrib)
  208.     {
  209.         printf(" %c%c%c%c%c%c",
  210.                 data1->ff_attrib&FA_RDONLY?'R':'-',
  211.                 data1->ff_attrib&FA_HIDDEN?'H':'-',
  212.                 data1->ff_attrib&FA_SYSTEM?'S':'-',
  213.                 data1->ff_attrib&FA_LABEL?'L':'-',
  214.                 data1->ff_attrib&FA_DIREC?'D':'-',
  215.                 data1->ff_attrib&FA_ARCH?'A':'-');
  216.     }
  217.     else
  218.     {
  219.         printf(" %2d:%02d%c",hour,min,tc);
  220.     }
  221.  
  222.     if ( split_screen && first_column )    /* handle split-screen output */
  223.     {
  224.         printf("│");
  225.         first_column = 0;
  226.     }
  227.     else
  228.     {
  229.         printf("\n");
  230.         lines_printed++;
  231.         if ( paged_list && ( lines_printed > (maxlines_printed-3) ) )
  232.         {                                /* handle paged listing */
  233.             register int i;
  234.  
  235.             printf("%62s","========== hit any key to continue ==========");
  236.             getch();                    /* wait for key */
  237.             for(i=0;i<62;i++) printf("\b \b");
  238.             lines_printed = 0;            /* reset counter */
  239.         }
  240.         first_column = 1;
  241.     }
  242. }
  243. void totals_output(char * name,long int number)
  244. {                                        /* outputs info with commas */
  245.     char num[20]="";                    /* number with commas */
  246.     char oldnum[20]="";                    /* number without commas */
  247.     register int x;                                /* # digits written */
  248.  
  249.     if ( paged_list && ( (maxlines_printed-lines_printed)<2) )
  250.     {                                /* handle paged listing */
  251.         register int i;
  252.  
  253.         printf("%62s","========== hit any key to continue ==========");
  254.         getch();                    /* wait for key */
  255.         for(i=0;i<62;i++) printf("\b \b");
  256.         lines_printed = 0;            /* reset counter */
  257.     }
  258.     ltoa( number, oldnum, 10 );            /* get number as a string */
  259.     x = ( strlen(oldnum) % 3 );            /* find # of digits in first group */
  260.     if (x == 0) x = 3;
  261.     strncpy(num, oldnum, x);            /* move first group */
  262.     while ( x < strlen(oldnum) )        /* move rest of number */
  263.     {
  264.         strcat(num,",");                /* add comma */
  265.         strncat(num, oldnum+x, 3);        /* move next group */
  266.         x+=3;                            /* update x */
  267.     }
  268.     printf("%s %11s\n",name,num);
  269.  
  270. }
  271.  
  272. long int size(long int bytes)
  273. {                                        /* computes output size of file */
  274.     long int i;
  275.     long int j;                            /* used in calculations */
  276.  
  277.     if ( !show_cluster && file_size )    /* show file size, not disk space */
  278.         return(bytes);
  279.     i = bytes / cluster_size;            /* # of full clusters */
  280.     j = bytes % cluster_size;            /* possible partial cluster */
  281.     if ( j ) i++;                        /* partial cluster */
  282.     if( !show_cluster )                    /* output disk space in bytes */
  283.         return(i * cluster_size);
  284.     return(i);                            /* output # of clusters */
  285. }
  286.  
  287. long int get_directory_size(char * s_dir,char * mask,int show_curr,int level)
  288. {                                        /* gets space occupied by dir. */
  289.     long int result = 0;                /* disk space */
  290.     long int temp = 0;                    /* used to calculate space */
  291.     register int files = 0;                /* # of files in directory */
  292.                                         /* used to calculate dir. size */
  293.     struct ffblk fileinfo;                /* used by findfirst/findnext */
  294.     char searchpath[80];                /* used in recursion */
  295.     char searchkey[80];                    /* used in findfirst */
  296.  
  297.     strcpy(searchkey, s_dir);            /* set up search key */
  298.     strcat(searchkey, mask);
  299.  
  300.     if ( findfirst(searchkey, &fileinfo, 0x3f) != -1 )
  301.     {                                    /* find first file matching key */
  302.         do
  303.         {                              /* calculations until no match */
  304.             temp=0;                    /* file found - size not yet known */
  305.             if ( ( fileinfo.ff_attrib & 0x06 ) != 0 )
  306.             {                           /* hidden/system file */
  307.                 if ( !show_hidden )
  308.                 {
  309.                     /*    hidden/system file.  do nothing */
  310.                 }
  311.                 else
  312.                 {                        /* process hidden/system files */
  313.                     temp = size(fileinfo.ff_fsize);
  314.                     if ( show_files && ( show_curr || !curr_dir ) )
  315.                     {                    /* show file */
  316.                         if (show_path)
  317.                         {
  318.                             printf("%-39s│",s_dir);
  319.                             first_column=0;
  320.                         }
  321.                         if (path_only)
  322.                             path_only_output(&fileinfo,temp,s_dir);
  323.                         else
  324.                             normal_output(&fileinfo, temp);
  325.                     }
  326.                     result += temp;        /* update size of dir. */
  327.                 }
  328.             }
  329.             else                        /* normal file/directory */
  330.                 if ( ( fileinfo.ff_attrib & 0x10 ) == 0 )
  331.                 {            /* file */
  332.                     temp=size(fileinfo.ff_fsize);
  333.                     if ( show_files && (show_curr || !curr_dir ) )
  334.                     {
  335.                         if (show_path)
  336.                         {
  337.                             printf("%-39s│",s_dir);
  338.                             first_column=0;
  339.                         }
  340.                         if (path_only)
  341.                             path_only_output(&fileinfo,temp,s_dir);
  342.                         else
  343.                             normal_output(&fileinfo,temp);
  344.                     }
  345.                     else
  346.                     {
  347.                         /* do nothing */
  348.                     }
  349.                     result+=temp;
  350.                 }
  351.                 else
  352.                     {
  353.                         /* directories are handled further down */
  354.                     }
  355.         } while ( findnext(&fileinfo) != -1 );
  356.     }
  357. /*        process directories        */
  358.     {
  359.         strcpy(searchkey,s_dir);        /* set up search key */
  360.         strcat(searchkey,"*.*");        /* match all files to find */
  361.                                         /* directories with matches */
  362.         if ( findfirst(searchkey, &fileinfo, 0x3f) != -1 )
  363.         {
  364.             do
  365.             {                            /* process until no match */
  366.                 files++;                /* file found */
  367.                 if ( ( fileinfo.ff_attrib & 0x06 ) != 0 )
  368.                 {
  369.                         /*    hidden/system file.  do nothing */
  370.                 }
  371.                 else
  372.                 if ( ( fileinfo.ff_attrib & 0x08 ) != 0 )
  373.                 {
  374.                     /* Volume Label - do nothing */
  375.                 }
  376.                 else
  377.                 if ( ( fileinfo.ff_attrib & 0x10) == 0 )
  378.                 {
  379.                     /* file - do nothing */
  380.                 }
  381.                 else        /* directory */
  382.                 if ( strcmp(fileinfo.ff_name, ".") &&
  383.                     strcmp(fileinfo.ff_name, "..") )
  384.                 {
  385.                     /* File is a Directory - compute and add size */
  386.                     /* Yes, Directories are handled here! */
  387.                     if ( traverse_sub )
  388.                     {
  389.                         int flag = show_sub;     /* flag becomes show_curr */
  390.                         strcpy(searchpath, s_dir);    /* in recursion */
  391.                         strcat(searchpath, fileinfo.ff_name);
  392.                         strcat(searchpath, "\\");
  393.                         temp = get_directory_size(searchpath,mask,flag,2);
  394.                         result += temp;        /* update size */
  395.                         if ( show_sub || show_curr )
  396.                         {                    /* print directory */
  397.                                 if (show_path)
  398.                                 {
  399.                                     printf("%-39s│",s_dir);
  400.                                     first_column=0;
  401.                                 }
  402.                                 if (path_only)
  403.                                     path_only_output(&fileinfo,temp,s_dir);
  404.                                 else
  405.                                     normal_output(&fileinfo,temp);
  406.                         }
  407.                     }
  408.                 }
  409.             }
  410.             while ( findnext(&fileinfo) != -1 );
  411.             if (dir_space && (level == 2))
  412.             {                            /* calc. size of dir. files */
  413.                 temp = size(files*32);    /* each dir. entry takes 32 bytes */
  414.                 result += temp;
  415.             }
  416.         }
  417.         return(result);
  418.     }
  419. }
  420.  
  421.  
  422. void process_option(char * option)
  423. {
  424.     switch ( *option )
  425.     {
  426.         case 'a':                            /* toggle output of files */
  427.         case 'A':                            /* default - off */
  428.             show_files = !show_files;
  429.             break;
  430.         case 'b':                            /* show file attributes instead of */
  431.         case 'B':                            /* file modification time */
  432.             show_attrib = !show_attrib;
  433.             break;
  434.         case 'c':                            /* toggle display by */
  435.         case 'C':                            /* # of clusters */
  436.             show_cluster = !show_cluster;    /* default - off */
  437.             break;
  438.         case 'd':                            /* toggle split-screen display */
  439.         case 'D':                            /* default - off */
  440.             split_screen = !split_screen;
  441.             break;
  442.         case 'f':                            /* toggle use of */
  443.         case 'F':                            /* file size, not disk space */
  444.             file_size = !file_size;
  445.             break;
  446.         case 'h':                            /* toggle counting of */
  447.         case 'H':                            /* default - on */
  448.             show_hidden = !show_hidden;
  449.             break;
  450.         case 'i':                            /* toggle counting of space */
  451.         case 'I':                            /* taken up by directory file */
  452.             dir_space = !dir_space;            /* default - on */
  453.             break;
  454.         case 'l':                            /* force cluster size to */
  455.         case 'L':                            /* specific # of bytes */
  456.             force_cluster = 1;
  457.             cluster_size = atoi(option+1);
  458.             if ( cluster_size == 0 )
  459.             {
  460.                 force_cluster = 0;
  461.             }
  462.             break;
  463.         case 'n':                            /* show path as well as */
  464.         case 'N':                            /* file information */
  465.             show_path = !show_path;
  466.             break;
  467.         case 'o':                            /* show only path, filename */
  468.         case 'O':                            /* and size */
  469.             path_only = !path_only;
  470.             break;
  471.         case 'p':                            /* toggle paging of output */
  472.         case 'P':                            /* default - off */
  473.             paged_list = !paged_list;
  474.             break;
  475.         case 'q':                            /* set maximum lines per page */
  476.         case 'Q':
  477.             maxlines_printed = atoi(option+1);
  478.             break;
  479.         case 'r':                            /* toggle recursive calls */
  480.         case 'R':                            /* default - on */
  481.             traverse_sub = !traverse_sub;
  482.             break;
  483.         case 's':                            /* toggle output of */
  484.         case 'S':                            /* subdirectories */
  485.             show_sub = !show_sub;            /* default - off */
  486.             break;
  487.         case 'x':                            /* toggle extended directory */
  488.         case 'X':                            /* default - off */
  489.             curr_dir = !curr_dir;            /* note: -a -s changed */
  490.             show_files = curr_dir;
  491.             break;
  492.         case 'z':                            /* toggle total statistics */
  493.         case 'Z':                            /* default - on */
  494.             total_stats = !total_stats;
  495.             break;
  496.         default:
  497.             printf("I don't know option '%c'\n", *option);
  498.             usage();
  499.             exit(1);                        /* unknown option: Usage & exit */
  500.     }
  501. }
  502.  
  503. void split_path(char *path)                 /* splits full path to */
  504. {                                            /* path & mask(file.ext) */
  505.     char drive[MAXDRIVE];
  506.     char dir[MAXDIR];
  507.     char name[MAXFILE];
  508.     char ext[MAXEXT];
  509.  
  510.     fnsplit(path,drive,dir,name,ext);
  511.     udrive=((drive[0]-'A')+1);
  512.     strcpy(mask,name);
  513.     strcat(mask,ext);
  514.     strcpy(path,drive);
  515.     strcat(path,dir);
  516. }
  517.  
  518. void process_dir(char *path)
  519. {                                    /* converts path to full path */
  520.     register char * cp;
  521.  
  522.     strcpy(searchdir, path);
  523.     while((cp = strchr(searchdir,'/'))!=NULL)
  524.         *cp = '\\';                    /* convert / to \ */
  525.     parspath(searchdir);
  526.     split_path(searchdir);            /* get mask */
  527. }
  528.  
  529. void main(int argc, char *argv[])
  530. {
  531.     long int size;                    /* directory size */
  532.     register int i;
  533.     register int x=0;                /* # directories specified */
  534.  
  535.     _BL=0x10;                /* call INT 10, Function 12, */
  536.     _AH=0x12;                /* subfunction 10 ( Get EGA config info) */
  537.     geninterrupt(0x10);
  538.     EGA=_BL;
  539.     if (EGA!=0x10)    /* EGA/VGA BIOS changes BL */
  540.         maxlines_printed = (*(char far *)MK_FP(0x0040,0x0084))+1;
  541.     else            /* other BIOSes don't have this function */
  542.         maxlines_printed = 25;
  543.  
  544.     for ( i = 1 ; i < argc ; i++ )
  545.     {                                /* process command line */
  546.         switch ( *argv[i] )
  547.         {
  548.             case '-':                /* option */
  549.                 process_option(argv[i]+1);
  550.                 break;
  551.             case '?':                /* request Usage report */
  552.                 usage();
  553.                 exit(0);
  554.             default:                /* assume pathname */
  555.                 if ( x == MAXDIRS )
  556.                 {                    /* currently 10 paths allowed */
  557.                     printf("too many arguments!\7\n");
  558.                     exit(1);
  559.                 }
  560.                 else
  561.                 {
  562.                     strcpy(temparg[x++],argv[i]);
  563.                     dir_specified = 1;
  564.                 }
  565.         }
  566.     }
  567.     if ( !dir_specified )
  568.     {                        /* no path - use current directory */
  569.         getcwd(buf, 80);
  570.         strcpy(temparg[x++],buf);
  571.         printf("no directory specified. Using \"%s\"\n",buf);
  572.     }
  573.  
  574.     for ( i = 0 ; i < x ; i++ )
  575.     {
  576.         process_dir(temparg[i]);
  577.         if ( show_cluster || !file_size )
  578.         {                            /* compute cluster size */
  579.             if ( !force_cluster )
  580.             {                       /* get cluster size */
  581.                 getdfree(udrive, &dinfo);
  582.                 cluster_size = dinfo.df_bsec * dinfo.df_sclus;
  583.             }
  584.             printf("directory : %s\n",searchdir);
  585.             printf("bytes per cluster = %d\n", cluster_size);
  586.         }
  587.         lines_printed=2;
  588.         size = get_directory_size(searchdir,mask,curr_dir,1);
  589.                                 /* get directory size */
  590.         if ( !first_column ) printf("\n");
  591.         printf("\n");
  592.         if (paged_list&&((maxlines_printed-lines_printed)<2))
  593.         {
  594.             register int i;
  595.  
  596.             printf("%62s","========== hit any key to continue ==========");
  597.             getch();                                    /* wait for key */
  598.             for(i=0;i<62;i++) printf("\b \b");
  599.             lines_printed = 0;
  600.         }
  601.         if ( total_stats )
  602.         {                                            /* print size */
  603.             totals_output(searchdir, size);
  604.         }
  605.     }
  606. }