Short: Recursive disk-usage analyser, pie chart Author: Markus Lunk Uploader: Markus Lunk Type: disk/misc Version: 1.1 Architecture: ppc-morphos >= 3.0 Distribution: Aminet DiskUsage - where did my disk space go? ======================================= DiskUsage scans a volume or a drawer, adds up the size of every file below it and shows the result largest-first, so the drawers eating the disk the most are the ones at the top of the window. The whole tree is sized ONCE, up front, so walking into a sub-drawer is instant and already sorted - no waiting and re-sorting after every double-click, which was my main annoyance of sizing drawers in an Ambient lister and my motivation for this tool. Three views of the same scan: List the current drawer's contents, biggest first, with size and percentage columns. Chart a donut diagram of those same items, one coloured wedge each, with a legend and a tooltip per slice. Biggest files the largest files ANYWHERE below the current drawer, each with the drawer it lives in - so one large file five levels down is a glance away instead of a hunt through "which are my largest directories?" but then they contain masses of small files instead of the large ones you are searching for. It also acts on what it finds: any item can be moved to the Trashcan or deleted outright, and the tree updates without a rescan - the bytes come off every drawer above it and the volume's free space is re-read. If you have your trashcan disabled through ENVARC:NOTRASHCAN, the menu items are disabled. Running it ---------- From Ambient, double-click the icon. From the Shell it also runs WITHOUT opening a window, which is what makes it scriptable: DiskUsage DIR,LIST/S,ALL/S,TOP/K/N,DEPTH/K/N,CSV/S,QUIET/S, OUTPUT/K,SORT/K,DEBUG/S Examples: --------- DiskUsage Work: - open the window on Work: DiskUsage Work: LIST - print the top level and exit DiskUsage Work: TOP 10 - the ten biggest files below it DiskUsage Work: CSV QUIET - one line a script can parse DiskUsage Work: LIST OUTPUT RAM:report.txt - write a report file to the target location There is an ARexx port - DISKUSAGE.1, because MUI numbers the first copy - offering SCAN, VIEW, GET, GETTOP, RESCAN, STOP, PARENT and QUIT. Three example scripts are in the Rexx drawer, one of which writes a report about several volumes unattended, for S:User-Startup or a Cron entry. Tool types ---------- DIR= the drawer/directory to scan at startup TOOLBARSIZE=<16|24> toolbar height. 24 is the default; anything other than 16 is treated as 24 DEBUG write a log to PROGDIR:DiskUsage.log Keyboard -------- Menu shortcuts are held with the RIGHT AMIGA key: O open, R rescan, S stop, P parent drawer, I open in lister, T move to Trashcan, D delete, E empty Trashcan, 1/2/3 the three views, ? about, Q quit. The toolbar buttons answer to P, R, S and D on their own. A shortcut is the CHARACTER, not the key it happens to sit on, so on a keymap where that character needs Shift you hold Shift as well. On a German keyboard "?" is above "ß", which makes About right-Amiga + Shift + ß. That is how MorphOS matches menu shortcuts generally. What is new in 1.1 ------------------- * Version bump for official release, no functional changes What is new in 0.58 ------------------- * Volumes over 2 TB now show their real size. 0.57 stopped DiskUsage believing a filesystem's placeholder, but it could then only fall silent - a 3.5 TB share got no size at all. MorphOS has a proper answer: GetFileSysAttr() with FQA_NumBlocks / FQA_NumBlocksUsed, which return 64-bit block counts and which any filesystem able to grow past 2 TB is required to implement. That is asked first now, with the old Info() figures as the fallback for everything else. What is new in 0.57 ------------------- * Fixed: a big volume could be shown at the wrong size, and as full when it was not. A 3.5 TB network share showed as "100% full (2.0 TB of 2.0 TB)". AmigaDOS counts a volume in blocks in signed 32-bit fields, which cannot hold one that large, so the filesystem had written a placeholder into both the size and the used count and DiskUsage believed it. Those placeholders are now recognised, and where the figures cannot be trusted the title shows the volume name alone rather than a confident wrong number. What is new in 0.56 ------------------- * Opening a drawer draws its chart about 2.5x quicker. 0.55 made hovering cheap; this does the same for the one computation it left. Working out which slice a point falls in is now a table lookup instead of a walk along every slice boundary, and the corners and the hole - nearly half the area the donut sits in - are filled without asking about them at all. 15.5 ms to 6.1 ms on the development machine. The picture is unchanged, and tested to be. What is new in 0.55 ------------------- * The chart redraws far more quickly, and looks exactly the same. Moving the pointer over the slices changes one colour, but the program was re-deriving the whole donut to do it - working out for every one of 731,000 subsamples which slice it belongs to. That is now worked out once and kept; a redraw just colours it in. On the development machine the redraw went from 17.6 ms to 0.131 ms, and the image is verified identical to the old one pixel for pixel. This helps every machine and the slowest ones most: an EFIKA 5200B or a Pegasos I has no AltiVec to fall back on, so the only thing that helps them is doing less work. What is new in 0.54 ------------------- * OUTPUT= wrote the report nowhere. The file name was still being pointed at inside dos.library's argument buffer after that buffer had been handed back, so the file was opened under whatever happened to be there by then. Fixed. * The toolbar comes in two sizes - TOOLBARSIZE=16 gives a smaller row with every gadget the same height. * The view chooser is the same height as the toolbar buttons again. * The chart no longer sits on a patch of its own colour, and does not flicker when a slice lights up under the pointer. * GET VIEW now answers what VIEW MODE accepts - LIST, CHART or TOP - so a script can read the current view and put it back afterwards. It used to reply with the label shown in the window, including "Biggest Files", which VIEW MODE cannot take. * The ARexx port is no longer called DISKUSAGE but enumerated, starting with DISKUSAGE.1, in order to allow multiple instances in parallel which makes sense especially when scripting DiskUsage. Requirements ------------ MorphOS 3.x on PowerPC, nothing else. At the 24-pixel toolbar size the Parent and Delete glyphs are Ambient's own, read from its drawer at run time, so the row matches every other toolbar on the system; at 16 pixels the program supplies its own. Status ------ Version 1.1 is the first public release. At the moment, I consider it feature-complete for my needs in the shape of a standalone program. It is a complete, self-contained program - the scanning core, the three views, and removing what they find all work and are tested - but it is still being polished. Reusing it as an auto-reordering Ambient lister is a later goal. The archive's Readme has the full documentation. Development assisted by GenAI. Freely distributable. (C) 2026 Markus Lunk.