ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/Utilities/AddDir.pm
Revision: 1.3
Committed: Thu Mar 18 10:32:04 1999 UTC (26 years, 1 month ago) by williamc
Content type: text/plain
Branch: MAIN
CVS Tags: V0_11_4, V0_11_3, V0_11_2, V0_11_1, V0_11_0, V0_10_19, V0_10_18, V0_10_17, V0_10_16, V0_10_15, V0_10_14, V0_10_13, V0_10_12, V0_10_11, V0_10_10, V0_10_9, V0_10_8, V0_10_7, V0_10_6, V0_10_5, V0_10_4, V0_10_3, V0_10_2, V0_10_1, V0_10_0, V0_10_0beta, V0_9_42, V0_9_41, V0_9_40, V0_9_39, V0_9_38, V0_9_37, V0_9_36, V0_9_35, V0_9_34, V0_9_33, V0_9_32, V0_9_31, V0_9_30, V0_9_29, V0_9_28, V0_9_27, V0_9_26, V0_9_25, V0_9_24, V0_9_23, V0_9_22, V0_9_21, V0_9_20, V0_9_19, V0_9_18, V0_9_17, V0_9_16, V0_9_15, V0_9_14, V0_9_13, V0_9_12, V0_9_11, V0_9_10, V0_9_9, V0_9_8, V0_9_7, V0_9_6, V0_9_5, V0_9_4, V0_9_3, V0_9_2, V0_9_1, V0_9, V0_8, V0_7, V0_6, V0_5, V0_4, V0_3, V0_2, V0_1
Branch point for: V0_9branch
Changes since 1.2: +1 -1 lines
Log Message:
Remove all subroutine templates - causing problems and not really needed to implement properly

File Contents

# Content
1 package AddDir;
2 require 5.001;
3 require Exporter;
4 use Cwd;
5 @ISA = qw(Exporter);
6 @EXPORT = qw(adddir);
7
8 sub adddir {
9 my $indir=shift;
10 my $startdir=cwd;
11 my @dir=split /\//, $indir;
12
13 if ( $indir=~/^\// ) {
14 chdir "/";
15 shift @dir;
16 }
17 umask 02;
18 foreach $dirname ( @dir ) {
19 next if ( $dirname eq "" );
20 if ( ! -e $dirname ) {
21 mkdir ( $dirname , 0775) ||
22 die "cannot make directory ".$dirname." $!\n";
23 print $i." ".$dirname."\n" if $debug;
24 }
25 chdir $dirname;
26 }
27 chdir $startdir;
28 }