home *** CD-ROM | disk | FTP | other *** search
/ PC Open 14 / pcopen14.iso / Zipped / DIRSIZE.ZIP / DIRSIZE.TXT < prev    next >
Encoding:
Text File  |  1997-10-23  |  22.4 KB  |  555 lines

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