--- loncom/interface/printout.pl 2003/09/01 03:30:57 1.37 +++ loncom/interface/printout.pl 2003/10/16 15:30:43 1.38 @@ -1,7 +1,7 @@ #!/usr/bin/perl # CGI-script to run LaTeX, dvips, ps2ps, ps2pdf etc. # -# $Id: printout.pl,v 1.37 2003/09/01 03:30:57 albertel Exp $ +# $Id: printout.pl,v 1.38 2003/10/16 15:30:43 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -26,6 +26,7 @@ # http://www.lon-capa.org/ # +use File::Path; use IO::File; use Image::Magick; print "Content-type: text/html\n\n"; @@ -48,8 +49,11 @@ use Image::Magick; my $eps_f = $not_eps; $eps_f =~ s/\.[^.]*$/\.eps/i; $_ = $eps_f; - m/\/([^\/]+)$/; + m/\/home\/httpd\/html\/res\/(.+)/; $eps_f = '/home/httpd/prtspool/'.$1; + my $path=$eps_f; + $path=~s/\/([^\/]+)\.eps$//; + File::Path::mkpath($path,0,0777); my $image = Image::Magick->new; $not_eps =~ s/^\s+//; $not_eps =~ s/\s+$//; @@ -69,7 +73,6 @@ use Image::Magick; } } } - unlink $figfile; } #print "$texfile\n"; #name of the tex file for debugging only if (-e $texfile) {