[LON-CAPA-cvs] cvs: loncom /interface printout.pl

matthew lon-capa-cvs@mail.lon-capa.org
Thu, 09 Sep 2004 15:30:49 -0000


matthew		Thu Sep  9 11:30:49 2004 EDT

  Modified files:              
    /loncom/interface	printout.pl 
  Log:
  Added more verbose logging to die messages.
  
  
Index: loncom/interface/printout.pl
diff -u loncom/interface/printout.pl:1.68 loncom/interface/printout.pl:1.69
--- loncom/interface/printout.pl:1.68	Mon Aug 30 16:05:31 2004
+++ loncom/interface/printout.pl	Thu Sep  9 11:30:49 2004
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 # CGI-script to run LaTeX, dvips, ps2ps, ps2pdf etc.
 #
-# $Id: printout.pl,v 1.68 2004/08/30 20:05:31 sakharuk Exp $
+# $Id: printout.pl,v 1.69 2004/09/09 15:30:49 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -86,7 +86,7 @@
   #do we have figures?
   if (-e $figfile) {
       my %done_conversion;
-      my $temporary_file=IO::File->new($figfile) || die "Couldn't open file for reading: $!\n";
+      my $temporary_file=IO::File->new($figfile) || die "Couldn't open fig file $figfile for reading: $!\n";
       my @content_of_file = <$temporary_file>;
       close $temporary_file;  
       my $noteps;
@@ -210,7 +210,7 @@
       } #to create index
       #Do we have a latex error in the log file?
       my $logfilename = $texfile; $logfilename =~ s/\.tex$/\.log/;
-      my $temporary_file=IO::File->new($logfilename) || die "Couldn't open file for reading: $!\n";
+      my $temporary_file=IO::File->new($logfilename) || die "Couldn't open log file $logfilename for reading: $!\n";
       my @content_of_file = <$temporary_file>;
       close $temporary_file; 
       my $body_log_file = join(' ',@content_of_file);
@@ -245,7 +245,7 @@
 	      print "<a href=\"$logfilename\">Your log file </a></big></b>";
 	      print "\n";
               #link tooriginal LaTeX file (included according Michael Hamlin desire)
-	      my $tex_temporary_file=IO::File->new($texfile) || die "Couldn't open file for reading: $!\n";
+	      my $tex_temporary_file=IO::File->new($texfile) || die "Couldn't open tex file $texfile for reading: $!\n";
 	      my @tex_content_of_file = <$tex_temporary_file>;
 	      close $tex_temporary_file; 
 	      my $body_tex_file = join(' ',@tex_content_of_file);
@@ -325,7 +325,7 @@
 		  print "<a href=\"$logfilename\">Your log file </a></big></b>";
 		  print "\n";
 		  #link tooriginal LaTeX file (included according Michael Hamlin desire)
-		  my $tex_temporary_file=IO::File->new($texfile) || die "Couldn't open file for reading: $!\n";
+		  my $tex_temporary_file=IO::File->new($texfile) || die "Couldn't open tex file $texfile for reading: $!\n";
 		  my @tex_content_of_file = <$tex_temporary_file>;
 		  close $tex_temporary_file; 
 		  my $body_tex_file = join(' ',@tex_content_of_file);
@@ -380,9 +380,9 @@
                                'a6'=>'<< /PageSize [298.75 421.1] >> setpagedevice',
 			   };
 	      if ($paper ne 'letter') {
-		  open(FFH,'<',$ps_file) || die "Couldn't open file for reading: $!\n";
+		  open(FFH,'<',$ps_file) || die "Couldn't open ps file $ps_file for reading: $!\n";
 		  my $new_ps_file='new'.$ps_file;
-		  open(FFHS,'>',$new_ps_file) || die "Couldn't open file for reading: $!\n";
+		  open(FFHS,'>',$new_ps_file) || die "Couldn't open new ps file $new_ps_file for reading: $!\n";
 		  print FFHS $addtoPSfile->{$paper}."\n";
 		  while (<FFH>) {
 		      print FFHS $_;