AW: Directory sizes

2010-05-05 Thread HACKER Nora
Hi Thomas, > For one thing, you're using just "du" to call the binary, so we can't > be sure you're calling the same "du" in each case. So, when logged in > on the remote machine, do "which du" and use the resulting fully > qualified path in your rexec call. Check, this is ok - locally an remotel

AW: Directory sizes

2010-05-04 Thread Thomas Bätzler
HACKER Nora asked: > Unfortunately, this does not explain the difference between the local > du and the one via rexec on a remote machine. Any help appreciated. When you're getting different results then you're doing something differently ;-) For one thing, you're using just "du" to call the bi

WG: Directory sizes

2010-05-04 Thread HACKER Nora
Hi, > my ( $rc2, $backupsizetrans ) = > rexec( > $backuphost, > 'du -k ' >. "$backupdir\/$backdir2" >. ' |tail -1 |awk \'{ print $1 }\'' > ); > > to get t

Directory sizes

2010-05-04 Thread HACKER Nora
Hi list, Maybe someone can help me with this, I have two strange directory size calculating issues: I do a my ( $rc2, $backupsizetrans ) = rexec( $backuphost, 'du -k ' . "$backupdir\/$backdir2"

Re: Printing directory sizes

2009-04-01 Thread Octavian Rasnita
- Original Message - On Tue Mar 31 2009 @ 11:08, Octavian Râşniţă wrote: Do you know if du has a parameter that lets us see the size of the files from chosen directories? I've seen that it shows the disk usage only. From man du: -a, --all write counts for all files

Re: Printing directory sizes

2009-03-31 Thread Telemachus
On Tue Mar 31 2009 @ 11:08, Octavian Râşniţă wrote: > Do you know if du has a parameter that lets us see the size of the files > from chosen directories? > > I've seen that it shows the disk usage only. >From man du: -a, --all write counts for all files, not just directorie

Re: Printing directory sizes

2009-03-31 Thread Octavian Râşniţă
To: "Lauri Nikkinen" On 04/03/2009, Lauri Nikkinen wrote: And I would like to write to script which prints into STDOUT (=cmd screen) all the directories in this folder (C:\Perl\) and and their size. So the out put should look like this: Directory bin: size xxx megabytes Directory cpan: size

Re: Printing directory sizes

2009-03-31 Thread Dan Wallis
On 04/03/2009, Lauri Nikkinen wrote: > And I would like to write to script which prints into STDOUT (=cmd screen) > all the directories in this folder (C:\Perl\) and and their size. So the out > put should look like this: > > Directory bin: size xxx megabytes > Directory cpan: size xxx megabytes >

Re: Printing directory sizes

2009-03-05 Thread Gunnar Hjalmarsson
Gunnar Hjalmarsson wrote: Dermot wrote: This will only give you the top level of directories: 07/02/2009 14:00 . 07/02/2009 14:00 .. 07/02/2009 14:00 bin 15/03/2006 22:14 eg 07/02/2009 14:00 html 15/03/2006 22:15

Re: Printing directory sizes

2009-03-05 Thread Gunnar Hjalmarsson
Dermot wrote: This will only give you the top level of directories: 07/02/2009 14:00 . 07/02/2009 14:00 .. 07/02/2009 14:00 bin 15/03/2006 22:14 eg 07/02/2009 14:00 html 15/03/2006 22:15 lib 27/04/2005 21:32

Re: Printing directory sizes

2009-03-05 Thread Lauri Nikkinen
I had to add $total_size_of_files_in_dir = 0; because it was accumulating. Now it does what is should do and I get the correct results!!! ---code--- #!/bin/perl use warnings; use strict; use File::Find; my $path = $ARGV[0]; die "You must supply a full directory path" unless (-e $path && -d $pa

Re: Printing directory sizes

2009-03-05 Thread Dermot
2009/3/5 Lauri Nikkinen : > Thanks, although is does not change the differences between dir sizes from > this script and Win Explorer folder properties. This e.g. shows that one of > my folders has 88 mb size although in fact it is empty. Thank you all, I'll > give up... > > -L > You have to be do

Re: Printing directory sizes

2009-03-05 Thread Lauri Nikkinen
Thanks, although is does not change the differences between dir sizes from this script and Win Explorer folder properties. This e.g. shows that one of my folders has 88 mb size although in fact it is empty. Thank you all, I'll give up... -L 2009/3/5 Dermot > 2009/3/5 Gunnar Hjalmarsson : > > La

Re: Printing directory sizes

2009-03-05 Thread Lauri Nikkinen
Well, I tried also this, ...snip... foreach my $dir (@directories) { find(\&wanted, $dir); ### Not sure how that worked as you called it $directory print "The total size of the file in $dir is " . sprintf("%.2f Kb", ($total_size_of_files_in_dir * 0.0009765625)) . "\n";

Re: Printing directory sizes

2009-03-05 Thread Dermot
2009/3/5 Gunnar Hjalmarsson : > Lauri Nikkinen wrote: >> >> ... from this script I get >> >> The total size of the file in etc is 15712.35 Kb >> The total size of the file in etc is 15.34 Mb >> >> and when I check this from Win XP Explorer (folder properties) window I >> get >> >> Size: 372 KB (380

Re: Printing directory sizes

2009-03-05 Thread Gunnar Hjalmarsson
Lauri Nikkinen wrote: ... from this script I get The total size of the file in etc is 15712.35 Kb The total size of the file in etc is 15.34 Mb and when I check this from Win XP Explorer (folder properties) window I get Size: 372 KB (380 928 bytes) What is the reason for this difference? Pr

Re: Printing directory sizes

2009-03-05 Thread Lauri Nikkinen
11 Dir(s) 28ÿ409ÿ733ÿ120 bytes free > >> > > >> > And I would like to write to script which prints into STDOUT (=cmd > >> > screen) > >> > all the directories in this folder (C:\Perl\) and and their size. So > the > >> > out &

Re: Printing directory sizes

2009-03-05 Thread Dermot
directories in this folder (C:\Perl\) and and their size. So the >> > out >> > put should look like this: >> > >> > Directory bin: size xxx megabytes >> > Directory cpan: size xxx megabytes >> > Directory eg: size xxx megabytes >> > Di

Re: Printing directory sizes

2009-03-04 Thread Jim Gibson
On 3/4/09 Wed Mar 4, 2009 10:26 AM, "Lauri Nikkinen" scribbled: > Ok, thanks, I wrote this based on your suggestions, and it seems to do what > I want. One further question, if you don't mind, how to format this so that > it prints sizes in megabytes, not in bits? How about dividing the result

Re: Printing directory sizes

2009-03-04 Thread Lauri Nikkinen
I could print out all the subdirectories also. > > > > -L > > 2009/3/4 Dermot > >> > >> 2009/3/3 Wagner, David --- Senior Programmer Analyst --- CFS > >> : > >> >> -Original Message- > >> >> From: lauri.ni

Re: Printing directory sizes

2009-03-04 Thread Dermot
rogrammer Analyst --- CFS >> : >> >> -Original Message- >> >> From: lauri.nikki...@gmail.com >> >> [mailto:lauri.nikki...@gmail.com] On Behalf Of Lauri Nikkinen >> >> Sent: Tuesday, March 03, 2009 11:38 >> >> To: Perl Beginners >

Re: Printing directory sizes

2009-03-04 Thread Lauri Nikkinen
rch 03, 2009 11:38 > >> To: Perl Beginners > >> Subject: Printing directory sizes > >> > >> Hi, > >> > >> I'm trying to print directory sizes using script from > >> > >> http://coding.derkeiler.com/Archive/Perl/perl.beginners/2

Re: Printing directory sizes

2009-03-04 Thread Dermot
2009/3/3 Wagner, David --- Senior Programmer Analyst --- CFS : >> -Original Message- >> From: lauri.nikki...@gmail.com >> [mailto:lauri.nikki...@gmail.com] On Behalf Of Lauri Nikkinen >> Sent: Tuesday, March 03, 2009 11:38 >> To: Perl Beginners >> Subjec

RE: Printing directory sizes

2009-03-04 Thread Wagner, David --- Senior Programmer Analyst --- CFS
> -Original Message- > From: lauri.nikki...@gmail.com > [mailto:lauri.nikki...@gmail.com] On Behalf Of Lauri Nikkinen > Sent: Tuesday, March 03, 2009 11:38 > To: Perl Beginners > Subject: Printing directory sizes > > Hi, > > I'm trying to prin

RE: Printing directory sizes

2009-03-04 Thread Wagner, David --- Senior Programmer Analyst --- CFS
Subject: Re: Printing directory sizes Thanks Chas! On windows side this seems to work C:\>perl -MFile::Find -le "print 'ok'" ok and it seems that File::Find module is installed though ppm won'

RE: Printing directory sizes

2009-03-04 Thread Wagner, David --- Senior Programmer Analyst --- CFS
> -Original Message- > From: lauri.nikki...@gmail.com > [mailto:lauri.nikki...@gmail.com] On Behalf Of Lauri Nikkinen > Sent: Tuesday, March 03, 2009 12:10 > To: Wagner, David --- Senior Programmer Analyst --- CFS > Cc: Perl Beginners > Subject: Re: Printing direct

Re: Printing directory sizes

2009-03-03 Thread Telemachus
On Tue Mar 03 2009 @ 4:03, Telemachus wrote: > > > > find( sub { -f and ( $size += -s _ ) }, $dir ); > > That line tests if each item in $dir is a *file* (-f). Sorry: hit send too quickly. What I meant to say there is that the subroutine tests for files - starting from whatever directory you sp

Re: Printing directory sizes

2009-03-03 Thread Telemachus
On Tue Mar 03 2009 @ 10:21, Lauri Nikkinen wrote: > Ok, thanks. Now I notice that I did not understand correctly what this > script does. I was trying to print sizes of all directories in the directory > tree. But anyway, I appreciate your kind help! The line find( sub { #code here}, $dir ) simply

Re: Printing directory sizes

2009-03-03 Thread Lauri Nikkinen
Ok, thanks. Now I notice that I did not understand correctly what this script does. I was trying to print sizes of all directories in the directory tree. But anyway, I appreciate your kind help! -L 2009/3/3 Chas. Owens > On Tue, Mar 3, 2009 at 14:59, Lauri Nikkinen > wrote: > snip > > On mac's

Re: Printing directory sizes

2009-03-03 Thread Chas. Owens
On Tue, Mar 3, 2009 at 14:59, Lauri Nikkinen wrote: snip > On mac's side I followed Chas's orders, but I can't get any output snip > #!/usr/bin/perl > > use warnings; > use strict; > use File::Find; > > my $dir = defined $ARGV[0] ? $ARGV[0] : '.'; > my $size; > > find( sub { -f and ( $size += -s _

Re: Printing directory sizes

2009-03-03 Thread Lauri Nikkinen
- > *From:* lauri.nikki...@gmail.com [mailto:lauri.nikki...@gmail.com] *On > Behalf Of *Lauri Nikkinen > *Sent:* Tuesday, March 03, 2009 13:00 > *To:* Chas. Owens > *Cc:* Wagner, David --- Senior Programmer Analyst --- CFS; Perl Beginners > *Subject:* Re: Printing directory siz

Re: Printing directory sizes

2009-03-03 Thread Lauri Nikkinen
Thanks Chas! On windows side this seems to work C:\>perl -MFile::Find -le "print 'ok'" ok and it seems that File::Find module is installed though ppm won't locate it (ppm query File::Find). And I don't know why. On mac's side I followed Chas's orders, but I can't get any output ~ > perl -MFile

Re: Printing directory sizes

2009-03-03 Thread Chas. Owens
On Tue, Mar 3, 2009 at 14:47, Lauri Nikkinen wrote: > I uninstalled ActiveState Perl via Add/Remove Programs and installed it > (ActivePerl 5.10.0 Build 1004) again from here > > http://www.activestate.com/activeperl/ > > and I got the same answer from ppm query File::Find. I don't know if it has

Re: Printing directory sizes

2009-03-03 Thread Chas. Owens
On Tue, Mar 3, 2009 at 14:28, Lauri Nikkinen wrote: snip > my $dir = $ARGV[0]; snip > find( sub { -f and ( $size += -s _ ) }, $dir ); > ~ > perl Print_directory_sizes.pl > invalid top directory at /System/Library/Perl/5.8.8/File/Find.pm line 592. > > So, something is wrong here also... snip What

Re: Printing directory sizes

2009-03-03 Thread Lauri Nikkinen
t; > From: lauri.nikki...@gmail.com > > [mailto:lauri.nikki...@gmail.com] On Behalf Of Lauri Nikkinen > > Sent: Tuesday, March 03, 2009 12:10 > > To: Wagner, David --- Senior Programmer Analyst --- CFS > > Cc: Perl Beginners > > Subject: Re: Printing directory sizes > > > >

Re: Printing directory sizes

2009-03-03 Thread John W. Krahn
Lauri Nikkinen wrote: It says that *** no packages installed matching 'File::Find *** I tried this also on my Mac and it goes like this ~ > perl -File::Find -le 'print "ok"' ok perldoc perlrun [ snip ] -Fpattern specifies the pattern to split on if -a is also in effect. The

Re: Printing directory sizes

2009-03-03 Thread Lauri Nikkinen
It says that *** no packages installed matching 'File::Find *** I tried this also on my Mac and it goes like this ~ > perl -File::Find -le 'print "ok"' ok ~ > cat Print_directory_sizes.pl #!/bin/perl use warnings; use strict; use File::Find; my $dir = $ARGV[0]; my $size; find( sub { -f and (

Re: Printing directory sizes

2009-03-03 Thread Chas. Owens
On Tue, Mar 3, 2009 at 14:15, Lauri Nikkinen wrote: > Ok, I typed > > C:\Perl>ppm query File > > to see that there is no File::Find module installed. It seems that > ActiveState does not offer it via ppm, am I right? snip The name of the module is File::Find, not File. Try ppm query File::Find

Re: Printing directory sizes

2009-03-03 Thread Chas. Owens
On Tue, Mar 3, 2009 at 14:09, Lauri Nikkinen wrote: > Thanks, how can I check if the module File::find is installed on my system? > I can't locate it from the ppm interface. snip File::Find is part of Core Perl, if it is not installed you have a bad install. -- Chas. Owens wonkden.net The most

Re: Printing directory sizes

2009-03-03 Thread Lauri Nikkinen
auri Nikkinen >> > Sent: Tuesday, March 03, 2009 11:38 >> > To: Perl Beginners >> > Subject: Printing directory sizes >> > >> > Hi, >> > >> > I'm trying to print directory sizes using script from >> > >> > htt

Re: Printing directory sizes

2009-03-03 Thread Lauri Nikkinen
auri.nikki...@gmail.com > > [mailto:lauri.nikki...@gmail.com] On Behalf Of Lauri Nikkinen > > Sent: Tuesday, March 03, 2009 11:38 > > To: Perl Beginners > > Subject: Printing directory sizes > > > > Hi, > > > > I'm trying to print directory sizes using script

Re: Printing directory sizes

2009-03-03 Thread Rob Dixon
Lauri Nikkinen wrote: > Hi, > > I'm trying to print directory sizes using script from > > http://coding.derkeiler.com/Archive/Perl/perl.beginners/2005-08/msg00693.html > > and when I try it from the cmd.exe > > C:\Perl>perl Print_directory_sizes.pl "

Printing directory sizes

2009-03-03 Thread Lauri Nikkinen
Hi, I'm trying to print directory sizes using script from http://coding.derkeiler.com/Archive/Perl/perl.beginners/2005-08/msg00693.html and when I try it from the cmd.exe C:\Perl>perl Print_directory_sizes.pl "C:/Temp" but I get an error message saying use of uninitial