- Timestamp:
- 2000-07-13T10:21:53+12:00 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/New_Config_Format-branch/gsdl/cgi-bin/webpage_delcol.pl
r841 r1279 1 #! /usr/local/bin/perl5-w1 #!perl -w 2 2 3 3 ########################################################################### … … 30 30 use CGI; 31 31 use GSDLHOME; 32 use Fcntl ':flock';33 32 34 33 require util; … … 73 72 &util::rm_r($col_dir); 74 73 75 # delete from collections.txt76 my $collist_filename77 = &util::filename_cat($ENV{'GSDLHOME'},"etc","collections.txt");78 if (open(CLIN,"<$collist_filename"))79 {80 if (flock(CLIN,LOCK_EX))81 {82 my @keep_dirnames = ();83 while (defined($line=<CLIN>))84 {85 chop $line;86 push(@keep_dirnames,$line) if ($line ne $dirname);87 }88 close(CLIN);89 90 if (open(CLIN,">$collist_filename"))91 {92 print CLIN join("\n",@keep_dirnames), "\n";93 }94 95 flock(CLIN,LOCK_UN);96 close(CLIN);97 }98 else99 {100 # problem locking file101 my $mess = "Unable to lock collection list configuration";102 $mess .= " file: $collist_filename";103 &webpageutil::error_location($args,$mess);104 return;105 }106 }107 else108 {109 # problem opening file for reading in110 111 my $mess = "Unable to open for input the collection list";112 $mess .= " configuration file: $collist_filename";113 &webpageutil::error_location($args,$mess);114 return;115 }116 74 } 117 75 elsif ($delete_area eq "import") … … 140 98 my $mess_url = "$args->{'httpbuild'}&bca=mess"; 141 99 $mess_url .= "&bc1dirname=$dirname" if ($delete_area ne "all"); 142 print " Content: text/html\n\n$mess_url&head=_headdone_&mess=_messdonedelcol_\n\n";100 print "Location: $mess_url&head=_headdone_&mess=_messdonedelcol_\n\n"; 143 101 return; 144 102
Note:
See TracChangeset
for help on using the changeset viewer.