--- loncom/publisher/lonretrieve.pm 2001/04/03 22:03:55 1.4 +++ loncom/publisher/lonretrieve.pm 2001/05/02 20:34:34 1.7 @@ -31,10 +31,11 @@ sub phaseone { my $resdir=$resfn; $resdir=~s/\/[^\/]+$/\//; - $fn=~/^\/(.+)\.(\w+)$/; + $fn=~/\/([^\/]+)\.(\w+)$/; my $main=$1; my $suffix=$2; - + + if (-e $resfn) { $r->print('
'); +} else { + $r->print('Copying file: '); + if (copy($csource,$ctarget)) { + $r->print('ok
'); + print $logfile "Copied sucessfully.\n\n"; + } else { + my $error=$!; + $r->print('fail, '.$error.'
'); + print $logfile "Copy failed: $error\n\n"; + } + $r->print('Back to '.$fn.''); } else { $r->print( 'Please pick a version to retrieve
'); @@ -143,3 +162,6 @@ sub handler { $r->print('