--- loncom/xml/scripttag.pm 2000/08/11 14:32:19 1.9 +++ loncom/xml/scripttag.pm 2000/08/11 15:27:58 1.12 @@ -92,12 +92,16 @@ sub editfield { sub getfile { my ($filename) = @_; my $a=""; - &Apache::lonnet::repcopy("/raw".$filename); - { - my $fh=Apache::File->new("/home/httpd/html/res".$filename); - while (<$fh>) { + + $filename=~ s/^\s*(\S+)\s*$/$1/; ## strip off leading and trailing spaces + $filename="/home/httpd/html/res".$filename; + if (! -e $filename ) { + &Apache::lonnet::subscribe($filename); + &Apache::lonnet::repcopy($filename); + } + my $fh=Apache::File->new($filename); + while (<$fh>) { $a .=$_; - } } return $a }