home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / utilities / utilst / treesize / !TreeSize / HowItWorks < prev    next >
Text File  |  1992-07-25  |  4KB  |  76 lines

  1.                      !TreeSize - How it Works
  2.  
  3. Each PROC and FN in the !RunImage file begins with a REM statement
  4. explaining what the routine does.
  5.  
  6. When you drag a directory icon to the application icon, the filer sends a
  7. message through the Wimp to our application, giving the full pathname of the
  8. directory whose icon you have dragged. This message is intended to invite us
  9. to load the object in question, but, instead, the application uses it when
  10. calling the procedure PROCdirectory, which simply catalogues the directory
  11. using the system call OS_GBPB, and proceeds to work through the entries,
  12. adding up the size of the files.
  13.  
  14. If it comes across a sub-directory, it call PROCdir, which performs a
  15. similar function to PROCdirectory, but does not produce a window. PROCdir is
  16. recursive, which means that, if it finds another sub-directory in the one
  17. which it is checking, it calls itself. In this way, the routine can deal
  18. with directories nested to any level.
  19.  
  20. Each time the procedure calls itself, it uses a bit more of the memory
  21. allocated to the application. The amount of memory is set by a line in the
  22. !Run file, and has been found to be sufficient for directories nested up to
  23. nineteen deep.
  24.  
  25. If you have a deeper nesting of directories on your disc, you may run out of
  26. memory, resulting in an error message, such as "No room". If this happens,
  27. you will need to edit the !Run file. This can be done by loading !Edit. You
  28. should then hold down Shift while double-clicking on the !TreeSize icon to
  29. show its directory, and dragging the !Run file icon to the !Edit icon.
  30.  
  31. The !Run file contains a line:-
  32.  
  33.                       Wimpslot -min 32k -max 32k
  34.  
  35. By changing the two 32k figures to a higher figure and resaving the file,
  36. you can increase the amount of memory allocated to the application. Note
  37. that memory is allocated in blocks of 8k, or 16k if your machine has more
  38. than 1Mb of RAM, so your higher figure should be a multiple of this amount.
  39.  
  40. This application uses multiple windows of different heights, which have to
  41. be created as required. Each window is based on a header window, whose
  42. template is contained in the Templates file.
  43.  
  44. Sixteen windows may be open at any one time, their details being held in
  45. array variables windno% and title%. Their titles are held as indirected data
  46. in a single memory block, at t_blk%. When a window is created, PROCfindspace
  47. checks the block for a string of zeros long enough to be overwritten by the
  48. title. When you close a window, it is also deleted, its title is cleared
  49. from the block and its array variables are reset.
  50.  
  51. If you press Escape during cataloguing, you interrupt the process of
  52. creating a window and adding icons to it, though the window has not, at this
  53. point, been opened. In order that this window does not become one of the
  54. sixteen that the application can handle, the error handler FNerror deletes
  55. it and removes its details from the window table.
  56.  
  57. During initialisation, the routine PROCfilesys checks for the presence of
  58. floppy and hard discs, and creates the main menu accordingly. It does this
  59. by using the system call OS_FSControl to detect the names of all existing
  60. filing systems, then using the name of each one to check for the existence
  61. of a system call "xxx_Drives", which returns the number of floppy or hard
  62. drives for that filing system. Each name is tried up to six times, as lower
  63. case, upper case and lower case with an initial capital, with or without the
  64. name being followed by the letters "FS".
  65.  
  66. If your you have a drive which does not appear on the menu, you can open a
  67. filer window on it and drag any object from its root directory to the
  68. application's icon with shift held down.
  69.  
  70. As the application knows nothing of the drag operation, it cannot check the
  71. shift key until it receives the message from the filer to load the object in
  72. question. That is why it is necessary to release the mouse button before you
  73. release the shift key.
  74.  
  75. I would like to thank Ian Copestake of Ian Copestake Software for his advice
  76. concerning the IDE filing system, and for testing the software.