Changeset 3522 for trunk/gsdl


Ignore:
Timestamp:
2002-11-11T15:17:25+13:00 (22 years ago)
Author:
jrm21
Message:

added a test to make sure that we can create the output file. Otherwise
pdftohtml prints out gibberish as the output filename in an error message.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/bin/script/pdftohtml.pl

    r3410 r3522  
    7575    my $input_filename = $ARGV[0];
    7676    my $output_filestem = $ARGV[1];
     77
    7778    $output_filestem =~ s/\.html$//i; # pdftohtml adds this suffix
     79
     80    # test that the directories exist to create the output file, or
     81    # we should exit immediately. (File:: is included by util.pm)
     82    my $output_dir =  File::Basename::dirname($output_filestem);
     83    if (! -d $output_dir || ! -w $output_dir) {
     84    die "pdftohtml.pl: cannot write to directory $output_dir\n";
     85    }
    7886
    7987    my @dir = split (/(\/|\\)/, $input_filename);
Note: See TracChangeset for help on using the changeset viewer.