View Full Version : Directory Size Calculator
LoRd_MuldeR
16th May 2007, 02:48
Hi.
I just put together a simple tool that recursively calculates the total size of directories and presents the results in a tree view. Also the directories/files will be sorted by their size, instead of alphabetical order. This is very useful in case your HDD is full once again and you wonder what the heck is eating all your diskspace ^^ I made this tool for my own purpose in first case, but maybe it can be helpful for others too. Feedback always welcome...
http://img296.imageshack.us/img296/9889/filedirsizecalc3bm5.png (http://img296.imageshack.us/img296/9889/filedirsizecalc3bm5.png)
Project Site & Downloads: http://mulder.dummwiedeutsch.de/home/?page=projects#dirsizecalc
mitsubishi
16th May 2007, 03:12
Actually this is really cool, cheers, will come in handy when I've filled up a partition with random crap again and need to go clean up.
LoRd_MuldeR
16th May 2007, 20:03
Here are some updates:
* Show size of Root Directory
* TreeView and ListView can now be resized within the window
* Added Popup-Menu to TreeView (use Right-Click)
* Added 'About' Dialog
LoRd_MuldeR
17th May 2007, 13:27
Some more fixes:
* Fixed some nasty resize issues
* Added "Refresh" button
* More options on the Popup Menu
LoRd_MuldeR
17th May 2007, 16:13
Small update:
Added "percentage" display for files/directories.
davidhorman
17th May 2007, 20:59
Have you tried the more graphical Overdisk (http://users.forthnet.gr/pat/efotinis/programs/overdisk.html)?
David
I've been meaning to write a tool just like that for ages! Excellent work.
Cheers,
-Nic
cyberbeing
18th May 2007, 03:12
Feature request:
The ability to delete things from both the folder (top) and file list (bottom).
The ability to jump directly to a file in explorer from the file list on bottom.
LoRd_MuldeR
18th May 2007, 12:40
Feature request:
The ability to delete things from both the folder (top) and file list (bottom).
I don't know whether deleting stuff should take place inside my application.
The ability to jump directly to a file in explorer from the file list on bottom.
I would do that if I only knew how to do it ;)
This works fine for directories, but doesn't work at all for files:
ShellExecute(Handle, 'explore', 'C:\Some Folder\Foobar', nil, nil, SW_SHOW)
Rainy
18th May 2007, 14:05
You might try ShellExecute(0,"open","explorer.exe","/select, \"filename\""),0,SW_SHOWNORMAL);
This will open windows explorer and select the file marked as 'filename'.
LoRd_MuldeR
18th May 2007, 14:25
You might try ShellExecute(0,"open","explorer.exe","/select, \"filename\""),0,SW_SHOWNORMAL);
This will open windows explorer and select the file marked as 'filename'.
Thx info. I will have a lool at that for next version :)
LoRd_MuldeR
18th May 2007, 14:28
Another Update:
* Fixed another resize issue (maximize is now disabled)
* Added "Delete" and "Move" operations to both Popup Menus (use with care!)
* New icon for "Refresh" button
cyberbeing
18th May 2007, 21:43
Thanks for adding the delete function. My reasoning behind requesting it is because I see using your tool first for seeing what is taking up all the space on my drive and then using it to free up space more efficiently when my drive starts to get full.
Would it be possible to make it delete to the recycle bin instead of permanently deleting like it seems to do now? That would give the extra level of safety in case you accidentally delete something.
smok3
18th May 2007, 21:56
Have you tried the more graphical Overdisk (http://users.forthnet.gr/pat/efotinis/programs/overdisk.html)?
David
another nice one:
http://www.win.tue.nl/sequoiaview/
LoRd_MuldeR
19th May 2007, 19:03
Would it be possible to make it delete to the recycle bin instead of permanently deleting like it seems to do now? That would give the extra level of safety in case you accidentally delete something.
I don't know how to do that :p
Currently I abuse the SHFileOperation function for moving/deleting files.
Unfortunately I don't see an option like "Move to Recycler" in docs...
http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/structures/shfileopstruct.asp?frame=true
// EDIT
Also I didn't have any success to get this working:
You might try ShellExecute(0,"open","explorer.exe","/select, \"filename\""),0,SW_SHOWNORMAL);
This will open windows explorer and select the file marked as 'filename'.
// EDITē
I found my mistake: The , was missing :rolleyes:
explorer.exe /select,"C:\Path to File\Foobar.txt"
foxyshadis
19th May 2007, 19:52
That would be FOF_ALLOWUNDO. (The docs kind of suck for that, I know.)
LoRd_MuldeR
19th May 2007, 19:59
That would be FOF_ALLOWUNDO. (The docs kind of suck for that, I know.)
ahh, thanks :D
LoRd_MuldeR
19th May 2007, 20:32
Feature requests fulfilled:
* Added feature to select files in Windows Explorer
* Directories/Files can be moved to Recycle Bin now
* Properties dialog for Files/Directories
* Various minor fixes
cyberbeing
19th May 2007, 23:02
All the new features seem to be working well. This is turning into a nice very nice little app. Nice job LoRd_Mulder :thanks:
More Suggestions:
For the size and percentage for folders and files could you do something to make it more organized/stand out more? (resizable columns? maybe color? something else?) When there are lots of files in the file view (in particular) it starts to get a little cluttered which makes picking out the info you want somewhat hard.
If you don't go the way or resizable columns could you make something to auto-fit the width of the window to to the longest file/folder name.
Add minimize and maximize in the upper right.
Add a basic search command (find/find next sort of thing) to find file/folder names in the directory tree. Because it is sorting by size it can sometimes be hard to find the file/folder you were interested in.
Show the explorer/associated icons for files
LoRd_MuldeR
19th May 2007, 23:35
More Suggestions:
For the size and percentage for folders and files could you do something to make it more organized/stand out more? (resizable columns? maybe color? something else?) When there are lots of files in the file view on bottom it starts to get a little cluttered which makes picking out the info you want somewhat hard.
If you don't go the way or resizable columns could you make something to auto-fit the width of the window to to the longest file/folder name.
I fear nothing of this can be done with Delphi's standard TreeView/ListView component :scared:
Add a basic search command (find/find next sort of thing) to find file/folder names in the directory tree. Because it is sorting by size it can sometimes be hard to find the file you were interested in.
Well, you can use the keys to "jump" through the Directory Tree.
If you want the files/folders to be ordered alphabetical, you can go back to a normal Filemanager...
Add minimize and maximize in the upper right.
It was disabled for a reason ;)
cyberbeing
20th May 2007, 05:35
Well, you can use the keys to "jump" through the Directory Tree.
If you want the files/folders to be ordered alphabetical, you can go back to a normal Filemanager...
I don't have anything against it being sorted by size but I didn't realized that I could use the keys to jump through them. That seems to work fine for what I was thinking of.
It was disabled for a reason ;)
OK, I just saw them missing so thought you might have overlooked it :p
LoRd_MuldeR
26th May 2007, 19:02
*Update*
The new version detects the cluster size of your hard drive and takes this value into account for calculating the size of files/directories. So Directory Size Calculator will now tell you how much space the files/directories really take on your hard drive. The differences for big files will be negligible, but if you have a directory with lots of small files in it, there can be a huge difference.
Also I removed all dependencies to JVCL from my source codes, so they should compile on Standard Delphi now and you don't need to install any additional components. Hopefully it will even compile on the free version of Turbo Delphi...
http://mulder.dummwiedeutsch.de/home/?page=projects#dirsizecalc
LoRd_MuldeR
1st August 2007, 16:55
They just sent me a review ;)
http://en.softonic.com/ie/64399?dev=64399
Download is still here:
http://mulder.dummwiedeutsch.de/home/?page=projects#dirsizecalc
HeadBangeR77
4th August 2007, 21:46
I have been absent for months - a very handy tool you've got there, and the lady who wrote the review is right as to its cons and pros ;)
:thanks:
LoRd_MuldeR
5th August 2007, 21:20
I have been absent for months - a very handy tool you've got there, and the lady who wrote the review is right as to its cons and pros ;)
:thanks:
Okay, I have added XML Export for the new version:
http://mulder.dummwiedeutsch.de/home/?page=projects#dirsizecalc
Right-click a folder and choose "Export XML Document" :)
cyberbeing
5th August 2007, 22:17
I'm not sure what caused it, but recently the delete function of Directory Size no longer seems to be working. I just get the following error:
http://img166.imageshack.us/img166/4990/errorcu9.png
LoRd_MuldeR
5th August 2007, 22:55
I'm not sure what caused it, but recently the delete function of Directory Size no longer seems to be working. I just get the following error:
http://img166.imageshack.us/img166/4990/errorcu9.png
Fixed in version 1.07a:
http://mulder.dummwiedeutsch.de/home/?page=projects#dirsizecalc
Sorry for any inconvenience :o
cyberbeing
6th August 2007, 01:32
Fixed in version 1.07a:
http://mulder.dummwiedeutsch.de/home/?page=projects#dirsizecalc
Sorry for any inconvenience :o
Thanks, that fixed it :)
When I export an XML for a directory it just puts question marks for any with Japanese filenames (when non-unicode is set to English in Windows). Same goes for directory size itself for displaying Japanese in the directory tree. Can you make it display and export Japanese (probably the same for other languages as well?) file names without having to set Windows non-unicode support to Japanese?
LoRd_MuldeR
6th August 2007, 01:44
The problem is that I don't have a Japanese system to test it. Furthermore Delphi 7 doesn't support Unicode natively. AFAIK there are Unicode Controls available by TntWare, but I never used those before. Also I would need to change my internal data structures as well as the Windows API calls in order to support Unicode. So in short: No Unicode support planned at the moment, sorry...
cyberbeing
6th August 2007, 03:26
Ok, it's not a big deal because if I set Windows XP to Japanese for non-unicode or just use Microsoft's AppLocal, Directory Size can display Japanese just fine.
For testing, if you have Windows XP its easy to change it to support foreign non-unicode programs and languages (like Japanese) through regional and language options in the control panel.
cyberbeing
13th April 2008, 23:46
I just had an idea last night that maybe a file size filter in Directory Size might be handy. Something where you would have an option to only show files above or below a certain file size.
So lets say I told it to only show files above 500MB. Directory Size would then hide any file and any folder without files above 500MB and recalculate the directory tree based on that. That could make searches for big files taking up space more efficient instead of having to search though every directory over 500MB that may only have lots of smaller files.
Would something like that be difficult to add?
LoRd_MuldeR
13th April 2008, 23:54
Well, I think it wouldn't be to hard to add, but I think it isn't that useful.
Big files and big folders will already be on the top of the list...
cyberbeing
14th April 2008, 00:26
Well, I think it wouldn't be to hard to add, but I think it isn't that useful.
Big files and big folders will already be on the top of the list...
It's more the idea of hiding the big folders which are made up of small files and ignoring all the small files in the size calculation (my computer has a lot of places like that). Setting it to only show files above say 500MB would show you the biggest folders made up of large files or the opposite with say setting it to only show files below 50MB would then show you the biggest folders made up of small files. I could see a feature like this being very useful to me for more focused cleaning.
LoRd_MuldeR
14th April 2008, 00:29
I'll think about it. But I'm busy with LameXP right now...
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.