+ my ($data,$config) = @_;
+ my $physical = $data->{'physical'};
+ my $virtual = encode_entities($data->{'virtual'});
+ my $new_physical = $data->{'new_physical'};
+ my $new_virtual = $data->{'new_virtual'};
+ my $dir = upper_path($new_virtual);
+ $new_virtual = encode_entities($new_virtual);
+
+ return error("This editor is not able to copy directories.") if(-d $physical);
+ return error("You have not enough permissions to copy this file.") unless(-r $physical);
+
+ if(-e $new_physical)
+ {
+ return error("A file or directory called '$new_virtual' already exists and this editor is currently not able to ask to overwrite the existing file or directory.",upper_path($virtual));
+ }
+
+ copy($physical,$new_physical) or return error("Could not copy '$virtual' to '$new_virtual'",upper_path($virtual));
+ return devedit_reload({command => 'show', file => $dir});