#!/usr/local/bin/perl -w # Copyright 1998 by John Halleck # All rights reserved require 5.0; use strict; use lib qw(/home/nahaj/lib); use treewalk qw(&doit &bustname $needspace $wantabs $wanthelp $wantdots $wantfull $wantbig $wantsize $wantperms $wantdirs $wantnogrf $maxdepth $nodirmessage $workingdir ); my $progversion = "Tree Directory 1.61 May 13th, 2000"; # --------- We use the treewalk.pm module, which assumes some # --------- Stubs in the main program that handle some needed # --------- tasks. Here are the stubs. Most are just returns. sub init { # Any global initialization. # print "DEBUG: Global initialization called\n"; return; } sub fini { # Any global termination code. # print "DEBUG: Global termination called\n"; return; } sub arginit { # Any per argument initialization my $argument = shift; # print "DEBUG: Argument initialization called with $given\n"; return; } sub argfini { # Any per argument termination code my $argument = shift; # print "DEBUG: Argument termination called\n"; return; } sub displayfile { # 0 to make this file invisible my $fullname = shift; my $inode = shift; # print "DEBUG: displayfile called with $fullname (inode: $inode)\n"; return 1; } sub wantdir { # Return 0 to force cull of tree here. my $fullname = shift; my $inode = shift; # print "DEBUG: wantdir called with $fullname (inode: $inode)\n"; return 1; } sub enterdirectory { my $indent = shift; my $dirname = shift; # print "$indent + DEBUG: directory initialization called with $fullname\n"; return; } sub exitdirectory { my $indent = shift; my $dirname = shift; # print "$indent + DEBUG: directory finalization called with $fullname\n"; return; } $needspace = 0; sub processfile { my $indent = shift; my $fullname = shift; $needspace = 0; # print "$indent + DEBUG: processfile called with $fullname\n"; return; } sub processdir { my $indent = shift; my $fullname = shift; $needspace = 0; # print "$indent + DEBUG: processfile called with $fullname\n"; return; } sub processuseropt { # No options specific to this package. my $opt = shift; # print "DEBUG: Process user options called with $opt\n"; return 0; # return 1 if you processed the option. } sub printuseropt { # Ditto # print "DEBUG: printuseroption called\n"; return; } sub defaultfile { # what to do if the user specified nothing. # print "DEBUG: Default file called...\n"; if (defined $workingdir) { return $workingdir } return ''; } sub mungename { my $given = shift; # print "DEBUG: Mungename called with $given\n"; return $given; } #--- Now that we have defined the stubs that say what we want # to do for each file, lets actually do the walk. &doit($progversion); exit 0;