Changeset 22076 for main/trunk


Ignore:
Timestamp:
2010-05-12T10:29:16+12:00 (14 years ago)
Author:
sjm84
Message:

Added error messages to these files that are printed when a write handle cannot be opened

Location:
main/trunk/greenstone2/perllib/dbutil
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/dbutil/gdbm.pm

    r21856 r22076  
    4848  $cmd .= " \"$infodb_file_path\"";
    4949
    50   if (!-e "$txt2db_exe" || !open($infodb_file_handle, "| $cmd"))
     50  if (!-e "$txt2db_exe")
    5151  {
    52     return undef;
     52      print STDERR "Error: Unable to find $txt2db_exe\n";
     53      return undef;
     54  }
     55
     56  if(!open($infodb_file_handle, "| $cmd"))
     57  {
     58      print STDERR "Error: Failed to open pipe to $cmd\n";
     59      print STDERR "       $!\n";
     60      return undef;
    5361  }
    5462
  • main/trunk/greenstone2/perllib/dbutil/gdbmtxtgz.pm

    r21856 r22076  
    5353  if (!open($infodb_file_handle, "| gzip - > \"$infodb_file_path\""))
    5454  {
    55     return undef;
     55      print STDERR "Error: Failed to open pipe to gzip - > \"$infodb_file_path\"\n";
     56      print STDERR "       $!\n";
     57      return undef;
    5658  }
    5759
  • main/trunk/greenstone2/perllib/dbutil/jdbm.pm

    r21856 r22076  
    6464  if (!open($infodb_file_handle, "| $txt2jdb_cmd"))
    6565  {
    66     return undef;
     66      print STDERR "Error: Failed to open pipe to $txt2jdb_cmd";
     67      print STDERR "       $!\n";
     68      return undef;
    6769  }
    6870
  • main/trunk/greenstone2/perllib/dbutil/sqlite.pm

    r21872 r22076  
    4040  my $sqlite3_exe = &util::filename_cat($ENV{'GSDLHOME'},"bin",$ENV{'GSDLOS'}, "sqlite3" . &util::get_os_exe());
    4141  my $infodb_handle = undef;
    42   if (!-e "$sqlite3_exe" || !open($infodb_handle, "| \"$sqlite3_exe\" \"$infodb_file_path\""))
    43   {
    44     return undef;
     42
     43  if (!-e "$sqlite3_exe")
     44  {
     45      print STDERR "Error: Unable to find $sqlite3_exe\n";
     46      return undef;
     47  }
     48
     49  if(!open($infodb_handle, "| \"$sqlite3_exe\" \"$infodb_file_path\""))
     50  {
     51      print STDERR "Error: Failed to open pipe to \"$sqlite3_exe\" \"$infodb_file_path\"\n";
     52      print STDERR "       $!\n";
     53      return undef;
    4554  }
    4655
Note: See TracChangeset for help on using the changeset viewer.