[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Final step (?)



Thanks for all the help so far. This is my latest version:
use Mac::Files;
$dir = "Strider:system folder";
chdir $dir || die;
&readDir( $dir );

sub readDir (){
	local($path) = $_[0];
	local($i) = 0;
	opendir( DIR, $path ) || die;
	local(@fileList) = readdir( DIR );
	closedir( DIR );

	while ($i++ <= $#fileList) {
		local ($fil) = "$path:$fileList[$i]";
		if(-d $fil) {&readDir( "$fil" ); print "$fil\n";}
		else{
		local ($dsize) = -s $fil;
		local ($has) = FSpGetCatInfo($fil);
		local ($rsize) = $has->{ioFlRLgLen};
		$total += ($rsize + $dsize);
		print "$fil $total\n";
		}
	}
}
print "$total\n";

but it seems to catch itself in a feedback loop. It ends up scanning my
whole hard drive, over and over and over. Needless to say, this takes too
long. The thing that confuses me is the output. It seems to me as though
each folder has in it an alias to its parent folder, but unnamed. I end up
with output like this:

Strider:system folder:Eudora Folder:Macperl:::::AdobeĻ PageMillŠ 2.0 Tryout
4693568
Strider:system folder:Eudora Folder:Macperl:::::Apple Extras 4693568
Strider:system folder:Eudora Folder:Macperl:::::AppleShare PDS 4693568
Strider:system folder:Eudora Folder:Macperl:::::Binder 4693568
Strider:system folder:Eudora Folder:Macperl:::::Clarity Installer Work 4693568
Strider:system folder:Eudora Folder:Macperl:::::Commercial 4693568
Strider:system folder:Eudora Folder:Macperl:::::Desktop DB 4693568
Strider:system folder:Eudora Folder:Macperl:::::Desktop DF 4693568
Strider:system folder:Eudora Folder:Macperl:::::Desktop Folder 4693568
Strider:system folder:Eudora Folder:Macperl:::::Downloads 4693568
Strider:system folder:Eudora Folder:Macperl:::::files 4693568
Strider:system folder:Eudora Folder:Macperl:::::Icon

where Macperl isn't in the Eudora Folder, and Pagemill, Apple Extras, etc.
are in my root. I just don't get it.

-Seraph



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch