-
- if($data->{'uselist'}->in_use($data->{'new_virtual'}))
- {
- return error("The target file '$new_virtual' already exists and it is edited by someone else.",$dir);
- }
-
- rename($physical,$new_physical) or return error("Could not move/rename '".encode_entities($virtual)."' to '$new_virtual'.",upper_path($virtual));
- return devedit_reload({command => 'show', file => $dir});
-}
-
-# exec_remove()
-#
-# Remove a file and return to directory view
-#
-# Params: 1. Reference to user input hash
-# 2. Reference to config hash
-#
-# Return: Output of the command (Scalar Reference)
-
-sub exec_remove($$)
-{
- my ($data,$config) = @_;
- my $physical = $data->{'physical'};
- my $virtual = $data->{'virtual'};
-
- return exec_rmdir($data,$config) if(-d $physical);
- return error_in_use($virtual) if($data->{'uselist'}->in_use($virtual));
-
- unlink($physical) or return error("Could not delete file '".encode_entities($virtual)."'.",upper_path($virtual));
- return devedit_reload({command => 'show', file => upper_path($virtual)});