Multi Commander > Support and Feedback

Bugs of CopyFile script function

(1/1)

Jungle:
I have the following script:


--- Code: ---@var $dst = GetTargetFocusPath();
@var $src = GetSourceFocusPath();

CopyFile( $dst, $src, "" );
--- End code ---

Target focused path is E:\temp\_mc_test\1, source focused path is E:\temp\_mc_test\2.

Debugger shows:

--- Code: ---$dst  string  E:\temp\_mc_test\1
$src  string  E:\temp\_mc_test\2
--- End code ---

Bug #1. When dialog appears, target path is E:\temp\_mc_test\ instead of E:\temp\_mc_test\1 (so if "NODIALOG" parameter is passed to CopyFile, error occurs "...Can not copy a file to itself").

Bug #2.  MC crashes when [Cancel] button is pressed in this copy dialog. It happens if copy was called from debugger.

Now assign this script to a QuickLaunch button. Enable Allow - Rearrange of buttons option for QL bar.

Bug #3. After copy dialog appears, this button will move over QL bar following mouse cursor (even if cursor is outside QL). Now:
  a) if you press Esc copy dialog will be closed and the button will take new position;
  b) if you click somewhere outside QL bar the button will take previous position and keep focus cursor around itself;

Mathias (Author):
I have not tested yet..
But I think it flips out because it does not understands that 1 and 2 are folders. it might take that as the src/target filename. (But not sure)

But try to add a slash \ to the end of $dst / $src, before sending to copyfile

$dst += "\";
$src += "\";

Jungle:
Indeed, it works with ending path delimiter

Navigation

[0] Message Index

Go to full version