version 1.6, 2006/06/19 09:36:22
|
version 1.8, 2007/07/25 17:43:34
|
Line 36 use Data::Dumper;
|
Line 36 use Data::Dumper;
|
use Storable qw(thaw); |
use Storable qw(thaw); |
use lib '/home/httpd/lib/perl/'; |
use lib '/home/httpd/lib/perl/'; |
use LONCAPA; |
use LONCAPA; |
|
use LONCAPA::Configuration; |
|
use Cwd; |
|
|
# |
# |
# Options |
# Options |
Line 66 END
|
Line 68 END
|
exit; |
exit; |
} |
} |
|
|
|
my %perlvar=%{&LONCAPA::Configuration::read_conf('loncapa.conf')}; |
|
|
# |
# |
# Loop through ARGV getting files. |
# Loop through ARGV getting files. |
while (my $fname = shift) { |
while (my $fname = shift) { |
my $dbref=&LONCAPA::locking_hash_tie($fname,&GDBM_READER()); |
$fname = &Cwd::abs_path($fname); |
|
my $dbref; |
|
if ($fname =~ m/^\Q$perlvar{'lonUsersDir'}\E/) { |
|
$dbref=&LONCAPA::locking_hash_tie($fname,&GDBM_READER()); |
|
} else { |
|
if (tie(my %db,'GDBM_File',$fname,&GDBM_READER(),0640)) { |
|
$dbref = \%db; |
|
} |
|
} |
|
|
if (!$dbref) { |
if (!$dbref) { |
warn "Unable to tie to $fname"; |
warn "Unable to tie to $fname"; |
Line 88 while (my $fname = shift) {
|
Line 100 while (my $fname = shift) {
|
} |
} |
print "$key = ".(ref($value)?Dumper($value):$value)."\n"; |
print "$key = ".(ref($value)?Dumper($value):$value)."\n"; |
} |
} |
&LONCAPA::locking_hash_untie($dbref); |
if ($fname =~ m/^\Q$perlvar{'lonUsersDir'}\E/) { |
|
&LONCAPA::locking_hash_untie($dbref); |
|
} else { |
|
untie($dbref); |
|
} |
} |
} |
exit; |
exit; |
|
|