Changeset 2656 for trunk/gsdl/bin/script/gsConvert.pl
- Timestamp:
- 2001-07-18T11:55:26+12:00 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/gsConvert.pl
r2600 r2656 358 358 # Was the conversion successful? 359 359 360 if (- e"$output_filestem.html") {360 if (-s "$output_filestem.html") { 361 361 open(TMP, "$output_filestem.html"); 362 362 $line = <TMP>; … … 367 367 } else { 368 368 # An error of some sort occurred 369 &util::rm("$output_filestem.html") ;369 &util::rm("$output_filestem.html") if -e "$output_filestem.html"; 370 370 &util::rm("$output_filestem.err") if -e "$output_filestem.err"; 371 371 } … … 396 396 if (system($cmd)!=0) 397 397 { 398 print STDERR "Error executing rtf converter: $!. Continuing...\n"; 398 print STDERR "Error executing rtf converter: $!.\n"; 399 # don't currently bother printing out error log... 400 # keep going, in case it still created an HTML file... 399 401 } 400 402 … … 402 404 403 405 # Was the conversion successful? 404 if (- e"$output_filestem.html") {406 if (-s "$output_filestem.html") { 405 407 return 1; 406 408 } 409 410 &util::rm("$output_filestem.html") if (-e "$output_filestem.html"); 407 411 408 412 return 0; … … 421 425 $!=0; 422 426 423 if (system($cmd)!=0) 427 my $retval=system($cmd); 428 if ($retval!=0) 424 429 { 425 430 print STDERR "Error executing $cmd"; 426 431 if ($!) {print STDERR ": $!";} 427 432 print STDERR "\n"; 428 return 0;429 433 } 430 434 431 435 # make sure the converter made something 432 if ( ! -e"$output_filestem.html")436 if ($retval!=0 || ! -s "$output_filestem.html") 433 437 { 434 438 &util::rm("$output_filestem.out") if (-e "$output_filestem.out"); 435 # print out the converter s std err, if any436 if (- e"$output_filestem.err") {439 # print out the converter's std err, if any 440 if (-s "$output_filestem.err") { 437 441 open (ERRLOG, "$output_filestem.err") || die "$!"; 438 442 print STDERR "pdftohtml:\n"; … … 442 446 close ERRLOG; 443 447 } 448 &util::rm("$output_filestem.html") if (-e "$output_filestem.html"); 449 &util::rm("$output_filestem.err") if (-e "$output_filestem.err"); 444 450 return 0; 445 451 } 446 452 453 &util::rm("$output_filestem.err") if (-e "$output_filestem.err"); 447 454 &util::rm("$output_filestem.out") if (-e "$output_filestem.out"); 448 455 return 1; … … 466 473 467 474 # make sure the converter made something 468 if (! -e "$output_filestem.text") 469 { 470 &util::rm("$output_filestem.out") if (-e "$output_filestem.out"); 475 if (! -s "$output_filestem.text") 476 { 471 477 # print out the converters std err, if any 472 if (- e"$output_filestem.err") {478 if (-s "$output_filestem.err") { 473 479 open (ERRLOG, "$output_filestem.err") || die "$!"; 474 480 print STDERR "pdftotext:\n"; … … 478 484 close ERRLOG; 479 485 } 486 # does this converter create a .out file? 487 &util::rm("$output_filestem.out") if (-e "$output_filestem.out"); 488 &util::rm("$output_filestem.text") if (-e "$output_filestem.text"); 489 &util::rm("$output_filestem.err") if (-e "$output_filestem.err"); 490 480 491 return 0; 481 492 } 482 483 493 &util::rm("$output_filestem.err") if (-e "$output_filestem.err"); 484 494 return 1;
Note:
See TracChangeset
for help on using the changeset viewer.