home *** CD-ROM | disk | FTP | other *** search
/ PC Open 12 / pcopen12.iso / MsDos / Dirsize / DIRSIZE.TXT < prev    next >
Encoding:
Text File  |  1997-04-05  |  23.4 KB  |  552 lines

  1. DIRSIZE v2.9
  2. ============
  3.  
  4. Copyright 1993-1997 Simon A Carter
  5.  
  6. The Directory Size/Wastage Lister with the Lot:
  7.  
  8.     *  Summary statistics for multi-level directories. This is very useful
  9.        for finding the complete size of applications before deletion or
  10.        backup.
  11.     *  Displays Windows 95 long filenames.
  12.     *  Supports international thousands separators.
  13.     *  The directories to be displayed can be limited by their size or
  14.        depth; very useful for eliminating unnecessary detail.
  15.     *  For the selected drive, displays actual cluster size, free space,
  16.        used space and capacity.
  17.     *  For each directory tree specified, displays cluster size (user-
  18.        selectable), total space used and wastage (as a percentage or as a
  19.        total).
  20.     *  For each directory displayed, shows total space, wasted space (as a
  21.        percentage or as a total), and if it has subdirectories, the total
  22.        space used by the directory and all of its subdirectories.
  23.     *  Shows wasted space for a given cluster size - optimise your cluster
  24.        size before repartitioning your hard disk.
  25.     *  Rounds up file sizes to the cluster size for the most accurate size
  26.        information.
  27.     *  Size/wastage information includes the size of directories
  28.        themselves.
  29.     *  Paginates output, [Enter] for next line, [Esc] to exit and any
  30.        other key for next page. Disabled automatically if output is
  31.        redirected.
  32.     *  Output can be redirected to a file or to the printer or into
  33.        another program.
  34.     *  The characters used to draw the directory tree can be changed from
  35.        DOS extended ASCII characters to standard ASCII characters for
  36.        other operating systems.
  37.     *  Comma-delimited and tab-delimited output formats for easy importing
  38.        into databases, spreadsheets or word processors for further
  39.        analysis or specialised printing.
  40.     *  Directory sorting can be disabled.
  41.     *  Future proof - directory sizes up to 99 GB are catered for.
  42.     *  Progress indicator as it accumulates file information.
  43.  
  44.  
  45. DirSize is SHAREWARE, and may be trialed for 30 days. You must register
  46. DirSize if you find it useful and plan to continue using it. Please see
  47. the end of this file for more information.
  48.  
  49.  
  50. What will DirSize do for me ?
  51. =============================
  52.  
  53. DirSize shows a graphical tree of the directories on your hard disk. The
  54. tree starts from the current directory, or from a directory or directories
  55. that you specify. The left column displays the total disk space used by
  56. each directory. Directories that contain further sub-directories display
  57. summary statistics in square brackets after the directory name. This is
  58. very useful for determining the complete size of an application, for
  59. example, if you were hunting for an application to remove to make way for
  60. a new one. Alternatively, DirSize can be used to find the total size of an
  61. application before a backup or copy is made.
  62.  
  63. DirSize automatically detects and displays Windows 95 long filenames. Of
  64. course, it will still run under any older version of DOS.
  65.  
  66.  
  67. Installation
  68. ============
  69.  
  70. Just copy DIRSIZE.EXE to a directory in your path, for example, to C:\DOS.
  71. To find out the directories in your path, type
  72.  
  73.    c:\> path    [Enter]
  74.  
  75.  
  76. How to use DirSize
  77. ==================
  78.  
  79. Typing
  80.  
  81.    dirsize -?   [Enter]
  82.  
  83. on its own will display usage information.
  84.  
  85. Usage:
  86.    dirsize [options]
  87.  
  88. Where [options] is one or more of:
  89. <directory>   Default: Current path
  90.               
  91.               One or more directories can be specified as the starting
  92.               point for DirSize's output. For a DirSize of drives a:, b:
  93.               and the current directory (c:\windows) type:
  94.               
  95.               c:\windows> dirsize a:\ b:\ .
  96.               
  97.               Directory names with special characters such as spaces must
  98.               be entered with double quotes e.g.
  99.               
  100.               c:\> dirsize "Program Files" "windows\start menu"   [Enter]
  101.               
  102.               You can perform multiple DirSize command in a single run
  103.               e.g.
  104.               
  105.               c:\> dirsize -1 c:\ -0 d:\
  106.               
  107. -nosort       Do not sort directory names into alphabetical order (the
  108.               default). This may be useful if you are comparing DirSize's
  109.               output to an unsorted listing from the DOS DIR command.
  110.               
  111. -p            Do not paginate the output. Pagination pauses after each
  112.               screenful of output. [Enter] shows the next line, [Esc]
  113.               exits, [End] scrolls continuously to the end of the output,
  114.               and any other key shows the next screen full of output.
  115.               Pagination is automatically disabled when the output is
  116.               redirected.
  117.               
  118. -size=#       Only show directories that use # space or larger. A K, M or
  119.               G suffix can be used to express the value in KBytes (1024
  120.               bytes), MBytes (1024 KBytes) or GBytes (1024 Mbytes). This
  121.               is very useful for finding network space hogs, or for
  122.               eliminating small directories that are of no consequence
  123.               from the display.
  124.               
  125. -cl=#         Show how much disk space would be wasted if the cluster size
  126.               was set to # bytes per cluster. # is restricted by DOS to
  127.               powers of two, but for convenience DirSize allows it to be
  128.               set to any value. This is useful for previewing the result
  129.               of a change in cluster size on a set of files. In general,
  130.               the smaller the cluster size, the smaller the wasted space.
  131.               As for -size=# above, a K, M or G suffix can be used.
  132.               
  133. -dir          Give the same results as a DIR - excluding all wastage
  134.               information.
  135.               
  136. -#            Default: All levels (255)
  137.               
  138.               Limits the number of levels of directories displayed to the
  139.               given value. Eg -1 will only show the first directory level.
  140.               The statistics will include all levels, but they will not be
  141.               displayed. This is very useful if you just need to find out
  142.               how much total space is in use by an application without
  143.               caring how it is divided into sub-directories. A value of 0
  144.               is equivalent to a value of 255 (i.e. all levels).
  145.               
  146. -comma        Print the result in a comma-delimited output format suitable
  147.               for importing into a spreadsheet, database or word
  148.               processor.
  149.               
  150. -tab          Same as -comma above but outputs in tab-delimited format.
  151.               
  152. -nowaste      Do not show wasted space for each directory. The wasted
  153.               space is still included in the totals - it is just not shown
  154.               as a display column.
  155.               
  156. -asval        Show the actual wasted space per directory rather than as a
  157.               percentage of the directory's used space.
  158.               
  159. -c<+|->       Control which characters to use for drawing lines.
  160.               
  161.               + Uses DOS's graphical line drawing characters even if it
  162.               detects that its output is being redirected.
  163.               - Uses portable text line drawing characters even if it
  164.               detects that its output is not being redirected. This is
  165.               useful if the result is going to be used on another
  166.               computer, for example, on a Unix machine or a Macintosh.
  167.               
  168.               Note: When DirSize detects that its output is being
  169.               redirected, it automatically turns off pagination, and
  170.               selects portable characters to draw lines, such as +, - and
  171.               |. It does this because the output may be sent to a device
  172.               or another computer that does not understand DOS's line
  173.               drawing characters (which are non-portable). When DirSize's
  174.               output goes to the screen, it uses the DOS line drawing
  175.               characters. You can override the default behaviour in either
  176.               case using the -c option
  177.  
  178.  
  179. DirSize Environment Variable
  180. ----------------------------
  181.  
  182. If you regularly use the same settings for DirSize, you can set them in
  183. the environment variable DirSize. This variable is processed before
  184. command line options, so anything specified on the command line will
  185. override it.
  186.  
  187. e.g.
  188.  
  189.    SET DIRSIZE=-nowaste -c- -nosort
  190.  
  191. Some of DirSize's command line options require an equals sign. In order to
  192. use these in an environment variable, change the equal sign (=) to a colon
  193. (:) eg -cl=# becomes -cl:#.
  194.  
  195.  
  196. Redirecting Output
  197. ------------------
  198.  
  199. DirSize's output can be redirected to any device. For example, to save
  200. DirSize's output to the file output.txt, you can type:
  201.  
  202.    dirsize > output.txt    [Enter]
  203.  
  204. To add DirSize output to an existing file exists.txt, type
  205.  
  206.    dirsize >> exists.txt    [Enter]
  207.  
  208. To send DirSize's output to the printer, type
  209.  
  210.    dirsize > prn    [Enter]
  211.  
  212.  
  213. DirSize Example
  214. ---------------
  215.  
  216. The output below was generated from running DirSize in the Program Files
  217. directory (in a DOS shell under Windows 95). All directories smaller than
  218. 2 MB have been removed from display:
  219.  
  220.    c:\> dirsize -size=2M "Program Files"    [Enter]
  221.    DirSize v2.9  Copyright (c) 1993-1997 Simon Carter
  222.    
  223.    Total space     Wstd  Directory name   [dir + subdirs total]
  224.    --------------  ----  ----------------------------------------------
  225.            32,768   97%  C:\Program files   [253,329,408]
  226.            32,768   99%  |--Borland   [98,500,608]
  227.            32,768   99%  |  |--Common Files   [4,358,144]
  228.         4,325,376   10%  |  |  +--Bde
  229.         4,096,000    6%  |  |--Database Desktop
  230.           229,376   37%  |  +--Delphi 2.0   [90,013,696]
  231.         9,207,808    9%  |     |--Bin   [9,699,328]
  232.            32,768   98%  |     |--Demos   [18,710,528]
  233.         5,898,240   35%  |     |  |--Data
  234.            32,768   98%  |     |  |--Db   [4,292,608]
  235.            32,768   98%  |     |  +--Doc   [3,735,552]
  236.        30,670,848    2%  |     |--Help   [32,833,536]
  237.         2,162,688    6%  |     |  +--Tools
  238.            32,768   99%  |     |--Images   [8,355,840]
  239.         5,341,184   98%  |     |  +--Buttons
  240.         9,863,168   58%  |     |--Lib
  241.         1,212,416   96%  |     |--Objrepos   [2,097,152]
  242.         2,293,760    2%  |     |--Quickrpt
  243.           557,056   58%  |     +--Source   [3,112,960]
  244.            32,768   99%  |--Common Files   [16,547,840]
  245.            32,768   98%  |  +--Microsoft Shared   [16,515,072]
  246.         2,293,760    4%  |     |--Msgraph5
  247.         2,883,584    6%  |     +--Proof
  248.         3,047,424   38%  |--Games
  249.         5,275,648   17%  |--Jobint
  250.         6,684,672   19%  |--Norton AntiVirus   [7,274,496]
  251.         2,326,528    7%  |--Norton Commander   [2,359,296]
  252.         9,011,200    9%  |--Norton Utilities   [15,007,744]
  253.         5,996,544   19%  |  +--System
  254.        11,370,496    3%  |--Painter3   [15,826,944]
  255.           753,664   17%  |--Plus!   [2,457,600]
  256.         5,603,328   14%  |--Resumew   [10,027,008]
  257.         3,342,336   67%  |  +--Resumes
  258.         2,162,688   32%  |--VendInfo
  259.         4,194,304    3%  |--Visio   [21,200,896]
  260.         2,752,512   14%  |  |--Add-ons
  261.         3,244,032    5%  |  |--Help
  262.            32,768   99%  |  |--Stencils   [4,882,432]
  263.         4,849,664   10%  |  |  +--Standard
  264.           163,840   52%  |  +--System   [4,751,360]
  265.         2,162,688   23%  |     +--Filter32
  266.         6,717,440    9%  |--Web3d   [37,715,968]
  267.         1,245,184    4%  |  |--Catalog   [19,496,960]
  268.         1,441,792   60%  |  |  |--Backdrop   [3,407,872]
  269.         6,684,672   14%  |  |  |--Model
  270.         2,752,512   53%  |  |  +--Surface   [4,554,752]
  271.            32,768   99%  |  |--Samples   [3,407,872]
  272.         2,654,208    7%  |  |  +--Stylebmp
  273.           491,520    7%  |  +--Webstyle   [7,995,392]
  274.           884,736   56%  |     +--Surface   [3,538,944]
  275.         2,555,904    8%  +--Winres
  276.    --------------  ----  ----------------------------------------------
  277.       253,329,408   25%  Cluster size: 32,768  Wastage: 64,893,638
  278.    --------------  ----  ----------------------------------------------
  279.    
  280.    Drive C: statistics:
  281.       Cluster size:         32,768 bytes
  282.         Free space:     26,247,168 bytes (2% of capacity is free)
  283.         Used space:  1,061,486,592 bytes
  284.           Capacity:  1,087,733,760 bytes
  285.  
  286.  
  287. Note how all sizes shown (except the wasted space) are integral (whole)
  288. multiples of the drive's cluster size.
  289.  
  290.  
  291. What is the "Cluster Size" ?
  292. ============================
  293.  
  294. When your computer places files on a disk (both hard disks and floppy
  295. disks), it must use an integral number of allocation units. The size of
  296. the allocation units varies depending on the total capacity of the disk.
  297. This means that if a file is smaller than one complete allocation unit, it
  298. does not fill the entire allocation unit. For example, lets say we have a
  299. file that is 300 bytes long. On a floppy disk with an allocation unit of
  300. 512 bytes, the file will only occupy the first 300 bytes, but since one
  301. entire allocation unit must be used, the remaining 212 bytes are wasted. A
  302. file 513 bytes long will occupy 2 allocation units, with 511 bytes wasted.
  303. An allocation unit is called a CLUSTER. Floppy drives typically use a
  304. cluster size of 512 bytes or 1,024 bytes, so not much space is wasted.
  305. Hard disks range from 2,048 bytes (for a 106 MB drive) to 32,768 bytes
  306. (for a 1.04 GB drive) and even 65,535 bytes, which means that a great deal
  307. of space is wasted. The cluster size gets bigger with bigger disks for two
  308. reasons:
  309.  
  310.    1)    A DOS limitation that sets an absolute upper maximum on the total
  311.          number of clusters on a drive (65535).
  312.    2)    The overhead of managing a large number of clusters consumes a
  313.          lot of disk space that cannot be used for anything else.
  314.  
  315. The DOS DIR command always shows you the size actually in use by the file
  316. - it does not include the extra 'wasted' space at the end of the cluster.
  317. This wasted space is sometimes referred to as 'slack' space.
  318.  
  319.  
  320. Directories use up clusters too
  321. -------------------------------
  322.  
  323. DirSize takes into account the amount of disk space used to store the
  324. entries within each directory. Normal file, directory and volume label
  325. entries take up 32 bytes each. Long filename entries can consume between 1
  326. and 32 additional directory entries (each of 32 bytes).
  327.  
  328. Even empty directories use a minimum of one cluster - for the current
  329. directory "." and the parent directory ".." entries. The root directory
  330. always consumes a fixed and pre-determined amount of disk space which
  331. cannot be reclaimed, and DirSize excludes the number of entries in the
  332. root directory from its calculations.
  333.  
  334. DirSize does not take into account the size of entries that are no longer
  335. being used. This means that a directory that has had many files deleted
  336. may display a size lower than that actually in use. DOS never reclaims
  337. this extra space unless you delete the directory.
  338.  
  339. To reduce the amount of disk space used by directories, remove directories
  340. that do not contain any files. Also, if you delete a large number of files
  341. from one directory (particularly directories containing long filenames),
  342. move the files to a new directory, remove the old one and then rename the
  343. new directory to the original name.
  344.  
  345.  
  346. Lost clusters
  347. -------------
  348.  
  349. Clusters can become orphaned when DOS is unable to complete changes to the
  350. disk, for example, when you are forced to reboot your machine or when the
  351. power is turned off accidentally. These clusters cannot be used until they
  352. are identified and reclaimed. Use the DOS CHKDSK or SCANDISK command to
  353. reclaim lost clusters. Lost clusters are considered to be used.
  354.  
  355.  
  356. Reducing wasted space
  357. =====================
  358.  
  359.  
  360. What about Disk Compression ?
  361. -----------------------------
  362.  
  363. Disk compression programs like Stacker and DoubleSpace are able to make
  364. use of the wasted space because they take on the responsibility of storing
  365. the files themselves. By doing so, they overcome DOS's integral cluster
  366. size limitation. DirSize's space wasted information may be invalid on
  367. volumes controlled by these programs, and on some later versions of file
  368. servers.
  369.  
  370.  
  371. What about archives ?
  372. ---------------------
  373.  
  374. Storing collections of files in a compressed or uncompressed archive saves
  375. space, because by grouping all of the files into one large file, only a
  376. small amount of space is wasted. The archive program uses its own format
  377. to store the files without wasting space.
  378.  
  379.  
  380. Partitions - decreasing the cluster size
  381. ----------------------------------------
  382.  
  383. Partitions subdivide a physical disk drive into a number of logical
  384. drives. For example, a 500 MB hard disk could be partitioned into two
  385. 250MB partitions, C: and D:. The advantage of doing this is that the
  386. cluster size can be smaller, and in general, the amount of wasted space
  387. will be smaller. The disadvantage is that it takes time to set up (since
  388. you have to move ALL of your data off the hard disk in order to partition
  389. it, unless you have a program that can re-partition on the fly), and you
  390. have to remember which drive your programs are on, and manage space across
  391. two drives instead of one. For more information on partitions, see the DOS
  392. FDISK command.
  393.  
  394.  
  395. New features/Revision history
  396. =============================
  397.  
  398. Date       Version   Changes Made
  399. 7-Mar-97   2.9       Added international thousands separator character
  400.                      support.
  401.                      Added support for file/directory sizes larger than 2
  402.                      GB.
  403. 24-Feb-97  2.8       Added welcome and information screen.
  404.                      Minor formatting change.
  405.                      Removed % display shown since inaccurate.
  406.                      Fixed screen scrolling.
  407.                      Even faster!
  408. 21-Feb-97  2.7       Added ability to limit the directories shown based on
  409.                      the amount of space they use.
  410.                      Added DirSize environment variable.
  411.                      Added option to totally ignore wasted space to give
  412.                      the same totals as a DOS DIR command.
  413.                      Changed command line options to have a - prefix
  414.                      instead of /
  415. 14-Oct-96  2.6       Added wastage percentage/value to display.
  416.                      Changed display format.
  417.                      Added wastage information for each directory.
  418.                      Increased speed (again).
  419.                      Added comma-delimited and tab-delimited database
  420.                      output formats.
  421.                      Added the actual size of the entries in each
  422.                      directory to the total size count.
  423.                      Added ability to limit directory depth and to specify
  424.                      multiple directories with separate parameters for
  425.                      each.
  426. 24-Jun-96  2.5       Reduced stack usage further.
  427.                      Added /nosort, /size=# and /p option.
  428.                      Added automatic pagination.
  429.                      Fixed bug for paths longer than 68 characters.
  430.                      Re-instated stack checking.
  431. 13-Jun-96  2.4       Increased stack limit to 64K, and reduced stack
  432.                      usage. This means that you can list directories that
  433.                      are much deeper than before. Appreciably faster (11
  434.                      seconds compared to 14 for a complete display of a
  435.                      1.1 GB drive).
  436.                      Now only shows usage information if /?, ? or -h given
  437.                      as first parameter.
  438.                      Email and address changes.
  439. 27-May-96  2.3       Documentation update.
  440. 8-May-96   2.2       Shows usage information if no parameters are
  441.                      provided.
  442.                      Fixed bug in long filename functions that prevented
  443.                      them from working under some circumstances.
  444.                      Fixed bug in file size rounding up function, which
  445.                      made files that were an integral number of clusters
  446.                      long one extra cluster long.
  447.                      Documentation update.
  448. 28-Apr-96  2.1       First release.
  449. 3-Jul-93   1.0       First created and used.
  450.  
  451.  
  452. Registration
  453. ============
  454.  
  455. Online Web Registration - Single User Version
  456. ---------------------------------------------
  457.  
  458. The registered version of DirSize can be purchased and received
  459. immediately on the Internet for $5 at AlbertÆs Ambry. Registration at
  460. AlbertÆs also eliminates shipping and currency conversion costs. Please go
  461. to:
  462.  
  463.   http://www.alberts.com/
  464.  
  465. Search for: dirsize
  466.  
  467. Click on the "Buy it" link to register DirSize.
  468.  
  469.  
  470. Order Form - All Versions
  471. -------------------------
  472.  
  473.     ____ x Single user licence(s) at   $5 each: $______
  474.     ____ x Server licence(s)      at  $50 each: $______
  475.     ____ x Site licence(s)        at $100 each: $______
  476.     ____ x Company licence(s)     at $200 each: $______
  477.     
  478.     Postage and 3.5" diskette                       $10
  479.       OR                                        OR
  480.     Deliver to your email address                    $5
  481.     
  482.                                         Total: $_______
  483.     
  484.     Personal details
  485.     ----------------
  486.     
  487.            Name: ____________________________________________
  488.           Email: ____________________________________________
  489.         Company: ____________________________________________
  490.         Address: ____________________________________________
  491.                  ____________________________________________
  492.                  ____________________________________________
  493.                  ____________________________________________
  494.           Phone: ____________________________________________
  495.             Fax: ____________________________________________
  496.  
  497.  
  498.     For Visa, MasterCard or Bank Card (*)
  499.     -------------------------------------
  500.     (Sorry, I currently do not accept American Express)
  501.     
  502.     Card Number: ____ ____ ____ ____
  503.     Expiry Date: ____/______
  504.     
  505.     
  506.       Signature: ________________________________
  507.     
  508.            Date: ____________
  509.     
  510.     (*) Please note that these orders are processed by Omnivision
  511.     Technologies, a licensed distributor.
  512.     
  513.     
  514.     Cheques
  515.     -------
  516.     I accept bank cheques and personal cheques drawn on an Australian
  517.     bank. Foreign cheques cost me an additional $US 10 to cover my bank's
  518.     foreign cheque charge. Please make cheques payable to Simon Carter.
  519.     
  520.     
  521.     Postal money orders
  522.     -------------------
  523.     I accept prepaid postal money orders in Australian dollars.
  524.     
  525.     
  526.     Other Payment Methods
  527.     ---------------------
  528.     I also accept foreign currencies (suitably disguised within an
  529.     envelope) provided they allow an extra $5 for currency conversion.
  530.  
  531.  
  532. Contact Information
  533. ===================
  534.  
  535. I am always happy to hear your comments! If you use and like DirSize, or
  536. have any suggestions for improvements, please drop me a line!
  537.  
  538.   Email:  launch@ozemail.com.au
  539.     WWW:  Checkout the Crystal Software home page at
  540.           http://www.ozemail.com.au/~launch
  541.     Fax:  +61-3 9800-3078  Any time.
  542.   Voice:  +61-3 9888-3104  After hours number. Please leave a contact
  543.           name, number and time, and I will try to get back to you within
  544.           24 hours.
  545.    Mail:  Simon Carter
  546.           Crystal Software
  547.           2 / 9 Woodbine Court
  548.           Wantirna
  549.           Victoria 3152
  550.           AUSTRALIA.
  551.     
  552.