X-Git-Url: https://git.p6c8.net/devedit.git/blobdiff_plain/0d3fcf0e34902845852297696024204919ffc164..9ba648e57a6e37366c685326c9997c3e643ce1ef:/modules/Command.pm?ds=inline diff --git a/modules/Command.pm b/modules/Command.pm index 1718982..6b413d0 100644 --- a/modules/Command.pm +++ b/modules/Command.pm @@ -6,7 +6,7 @@ package Command; # Execute Dev-Editor's commands # # Author: Patrick Canterino -# Last modified: 2003-12-18 +# Last modified: 2003-12-21 # use strict; @@ -566,7 +566,7 @@ sub exec_workwithdir($$)
-

Move/Rename directory '$virtual' to: $dir

+

Move/Rename directory '$virtual' to:
$dir


@@ -679,7 +679,44 @@ sub exec_rename($$) 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)); + if(-d $new_physical) + { + return error("A directory called '$new_virtual' already exists. You cannot replace a directory!",upper_path($virtual)); + } + elsif(not $data->{'cgi'}->param('confirmed')) + { + $dir = encode_entities($dir); + + my $output = htmlhead("Replace existing file"); + $output .= <<"END"; +

A file called '$new_virtual' already exists. Do you want to replace it?

+ +
+ + + + + +

+
+ +
+ + + +

+
+END + + $output .= htmlfoot; + + return \$output; + } + } + + 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));