Ignore:
Timestamp:
2008-05-27T12:17:05+12:00 (16 years ago)
Author:
mdewsnip
Message:

(Adding new DB support) Creating a new "open_infodb_write_handle()" function in dbutil.pm to remove the last bit of GDBM-specific code from basebuilder.pm.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/dbutil.pm

    r15710 r15711  
    3838
    3939
     40sub open_infodb_write_handle
     41{
     42    my $infodb_file_path = shift(@_);
     43
     44    return &open_infodb_write_handle_gdbm($infodb_file_path);
     45}
     46
     47
    4048sub read_infodb_file
    4149{
     
    7078    my $infodb_file_name = &util::get_dirsep_tail($collection_name) . $infodb_file_extension;
    7179    return &util::filename_cat($infodb_directory_path, $infodb_file_name);
     80}
     81
     82
     83sub open_infodb_write_handle_gdbm
     84{
     85    my $infodb_file_path = shift(@_);
     86
     87    my $txt2db_exe = &util::filename_cat("$ENV{'GSDLHOME'}/bin/$ENV{'GSDLOS'}", "txt2db" . &util::get_os_exe());
     88    if (!-e "$txt2db_exe" || !open(PIPEOUT, "| $txt2db_exe \"$infodb_file_path\""))
     89    {
     90    return undef;
     91    }
     92
     93    return *PIPEOUT;
    7294}
    7395
Note: See TracChangeset for help on using the changeset viewer.