Home > Archive > PerlTk > October 2005 > treesize for linux
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
treesize for linux
|
|
| transam 2005-10-14, 6:57 pm |
| Dear perl/tk friends,
I wrote a utility for linux, that shows the size of a given
directory tree and its braches.
http://tkltrans.sourceforge.net/magyar/treesize.tar.gz
It is ideal to find out, which directories use a lot
of disk space.
I hope, it will be as useful for others, as for me..
Regards, tr.
| |
| zentara 2005-10-15, 6:56 pm |
| On 14 Oct 2005 14:47:19 -0700, "transam" <transam45@gmx.net> wrote:
>Dear perl/tk friends,
>I wrote a utility for linux, that shows the size of a given
>directory tree and its braches.
>http://tkltrans.sourceforge.net/magyar/treesize.tar.gz
>It is ideal to find out, which directories use a lot
>of disk space.
>I hope, it will be as useful for others, as for me..
>
>Regards, tr.
Pretty nice. I have a couple of simple suggestions.
1.
Put a binding in the "Initial Directory" entry box, so when
you enter a directory, you can hit "Enter" to refresh it, instead
of having to click the Refresh button.
2.
If you can figure out a way, make the color of the "size in megs"
different from the directory name. I have alot of directories of source
code, that end in numbers, and it is hard to read the size, when it is
the same color.
--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
| |
| transam 2005-10-16, 6:56 pm |
| Dear zentara,
Thanks for the suggestions. I'll try to
realize both.
tr.
| |
|
| zentara <zentara@highstream.net> wrote:
> On 14 Oct 2005 14:47:19 -0700, "transam" <transam45@gmx.net> wrote:
>
>
> Pretty nice. I have a couple of simple suggestions.
>
> 1.
> Put a binding in the "Initial Directory" entry box, so when
> you enter a directory, you can hit "Enter" to refresh it, instead
> of having to click the Refresh button.
>
> 2.
> If you can figure out a way, make the color of the "size in megs"
> different from the directory name. I have alot of directories of source
> code, that end in numbers, and it is hard to read the size, when it is
> the same color.
Same comment here, and a space would help. Mostly, though, 2 small errors:
[lusol@dragonfly:~/Desktop] diff treesize.pl.orig treesize.pl
179c179,180
< my $tree = $mw->Scrolled(qw/Tree -width 80 -height 40 -background #fffff8 /)->pack(-fill => 'both', -expand => 1);
---
> #my $tree = $mw->Scrolled(qw/Tree -width 80 -height 40 -background #fffff8 /)->pack(-fill => 'both', -expand => 1);
> my $tree = $mw->Scrolled(qw/Tree -width 80 -height 40 -background / => '#fffff8')->pack(-fill => 'both', -expand => 1);
209c210,211
< open(DU, "du $initialdir -b | sort -rn |") or die "Pech!";
---
> # open(DU, "du $initialdir -b | sort -rn |") or die "Pech!";
> open(DU, "du -k $initialdir | sort -rn |") or die "Pech!";
The first = fixes a warning.
The second = there is no -b option on the du's i have access to
.... but the "fix" is improper because the units are now incorrect.
FYI. Looks good otherwise....
Steve
--
@_=map{eval"100${_}"}split/!/,'/5!*2!+$]!/10+$]';use Tk;$m=tkinit;$t='just an'.
'other perl hacker';$z='createText';$c=$m->Canvas(-wi,$_[1],-he,25)->grid;$c->$
z(@_[2,3],-te,$t,-fi,'gray50');$c->$z($_[2]-$],$_[3]-$],-te,$t);$m->bind('<En'.
'ter>',sub{$y=int(rand($m->screenheight));$m->geometry("+$y+$y")});MainLoop;
| |
| transam 2005-10-21, 6:58 pm |
| Thanks for the ideas.
I added a keyboard bind 'r' for refresh.
The color is still the same for size and name. I could not find how to
change it on the same line.
The hanges lusol suggested, are now included.
The file is now on
http://tkltrans.sourceforge.net/magyar/treesize.tar.gz
Thanks, tr.
| |
| Jack D 2005-10-21, 6:58 pm |
| "transam" <transam45@gmx.net> wrote in message
news:1129924067.716936.17580@f14g2000cwb.googlegroups.com...
> Thanks for the ideas.
>
> I added a keyboard bind 'r' for refresh.
> The color is still the same for size and name. I could not find how to
> change it on the same line.
> The hanges lusol suggested, are now included.
>
> The file is now on
> http://tkltrans.sourceforge.net/magyar/treesize.tar.gz
>
Forgive him "lusol" :-)
Transam - may I introduce to you to Stephen Lidie - revered author of
Mastering Perl/Tk.
http://www.oreilly.com/catalog/mastperltk/
You are getting suggestions from one of the best !
--
Jack
|
|
|
|
|