41 |
# return: path on filesystem to data dir |
# return: path on filesystem to data dir |
42 |
|
|
43 |
sub open_data_files { |
sub open_data_files { |
44 |
my ($db_dir) = @_; |
my ($db_dir,$debug) = @_; |
45 |
|
|
46 |
mkdir "$common::install_dir/$db_dir" if (!-e "$common::install_dir/$db_dir"); |
mkdir "$common::install_dir/$db_dir" if (!-e "$common::install_dir/$db_dir"); |
47 |
mkdir "$common::install_dir/$db_dir/data" if (!-e "$common::install_dir/$db_dir/data"); |
mkdir "$common::install_dir/$db_dir/data" if (!-e "$common::install_dir/$db_dir/data"); |
50 |
|
|
51 |
open(S,"> $dir/stream") || die "can't open output $dir/stream: $!"; |
open(S,"> $dir/stream") || die "can't open output $dir/stream: $!"; |
52 |
open(R,"> $dir/bib") || die "can't open output $dir/bib: $!"; |
open(R,"> $dir/bib") || die "can't open output $dir/bib: $!"; |
53 |
open(MPS,"| $common::mpsindex -d $common::install_dir/$db_dir -autokey") || die "can't start MPS indexer $common::mpsindex: $!"; |
if (! $debug) { |
54 |
# open(MPS,"> /tmp/mpsindex") || die "mps: $!"; |
open(MPS,"| $common::mpsindex -d $common::install_dir/$db_dir -autokey") || die "can't start MPS indexer $common::mpsindex: $!"; |
55 |
|
} else { |
56 |
|
open(MPS,"> /tmp/mpsindex") || die "mps: $!"; |
57 |
|
} |
58 |
|
|
59 |
print S $common::mps_header; |
print S $common::mps_header; |
60 |
print MPS $common::mps_header; |
print MPS $common::mps_header; |