1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
#!/usr/local/bin/perl
;#
;# Copyright (c) 1996, Ikuo Nakagawa.
;# All rights reserved.
;#
;# $Id: mkdirinfo,v 1.2 1997/05/22 08:39:27 ikuo Exp $
;#
;# mkdirinfo - generate directory information.
;#
;# IMPORTANT: change to the package directory
$prefix = '/usr/local/lib/ftpmirror';
unshift(@INC, $prefix);
;# modules
use Getopt::Std;
require "dirinfo.pl";
require "log.pl";
;# prototypes - for perl5.003 or later
;# sub usage();
;# store he basename of current program name
($program) =~ ($0 =~ m#([^/]+)$#);
;# print usage and exit
sub usage {
die("Usage: $program [-rd] directory [directory...]\n");
}
;# parsing options and do real work
&getopts("rd") || &usage;
$opt_r = 0 if !defined($opt_r);
$opt_d = 0 if !defined($opt_d);
;#
log::mask("DEBUG") if $opt_d;
;# ARGV are directories to make dirinfo
for $dir (@ARGV) {
# first, we go to the working directory
chdir($dir) || do { warn("chdir($dir): $!"), next };
dirinfo::update_dirinfo($dir);
}
|