Information in this document is subject to change without notice. The example companies, organizations, products, people, and events depicted herein are fictitious. No association with any real company, organization, product, person or event is intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation.
Microsoft may have patents, patent applications, trademarked, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property.
© Microsoft Corporation. All rights reserved.
Microsoft, MS-DOS, MS, Windows, Windows NT, MSDN, Active Directory, BizTalk, SQL Server, SharePoint, Outlook, PowerPoint, FrontPage, Visual Basic, Visual C++, Visual J++, Visual InterDev, Visual SourceSafe, Visual C#, Visual J#, and Visual Studio are either registered trademarks or trademarks of Microsoft Corporation in the U.S.A. and/or other countries.
Other product and company names herein may be the trademarks of their respective owners.
This source code is subject to terms and conditions of the Apache License, Version 2.0. A copy of the license can be found in the License.html file at the root of this distribution. If you cannot locate the Apache License, Version 2.0, please send an email to ironpy@microsoft.com. By using this source code in any fashion, you are agreeing to be bound by the terms of the Apache License, Version 2.0.
DiskUse - Graphical Disk Usage Utility
Contributor: Jocelyn Turcotte
Prerequisites
The prerequisites to successfully run this application are:
Please make sure the folder structure in your current working directory (the DiskUse directory) is:
.\app.py
.\dialogutil.py
.\filestruct.py
.\mainWindow.xaml
.\readme.htm
.\renderers.py
.\uilogic.py
HINT: if the folder containing the IronPython distribution is not already in your PATH environment variable, please add it from the command prompt you'll be working in. By doing this you will be able to run the "ipy" command from any arbitrary directory:
set PATH=%PATH%;%ProgramFiles%\IronPython 2.6
From the command prompt, navigate to the DiskUse directory and type the following:
C:\Users\username> ipy.exe app.py
This utility asks you to choose a base directory on your disk or network, and displays the subdirectories and files in that base directory within a TreeView widget. When you expand a directory node of the TreeView, DiskUse calculates the sizes of all files in that directory and builds a graphical diagram that is displayed in the right pane of the main window.
This utility uses Windows Presentation Foundation (WPF) for user interface (UI) rendering. It uses a simple Xaml file for UI structure and geometries to draw the diagrams on a canvas.
DiskUse utilizes Windows Forms for the directory selection dialog as well as to get the absolute pointer position on the screen.

More Details
The application can be started by running app.py directly or by importing app.py in a console session. Importing app.py will run the application in a new thread allowing interactive queries.
After initialization, an IronDiskUsage object is
created - this object creates the main window from the Xaml file and
attaches events to the window.
The two main components of the application are the file list and
diagram renderer, both of which are controlled by their respective
attached objects, FileListKeeper and VerticalRectanglesRenderer.
The module filestruct interfaces with the file system and builds the DiskFile and DiskDir
classes that are used by the file list and
renderer to display information to the user (names and size of files
and directories).
This utility will show file sizes and not actual "cluster space" used by them
To select a different base directory for DiskUse to analyze, just restart the application