Multi Commander Support Forum

Multi Commander => Support and Feedback => Topic started by: Jungle on January 23, 2014, 12:24:11

Title: Bugs of CopyFile script function
Post by: Jungle on January 23, 2014, 12:24:11
I have the following script:

Code: [Select]
@var $dst = GetTargetFocusPath();
@var $src = GetSourceFocusPath();

CopyFile( $dst, $src, "" );

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

Debugger shows:
Code: [Select]
$dst  string  E:\temp\_mc_test\1
$src  string  E:\temp\_mc_test\2

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;
Title: Re: Bugs of CopyFile script function
Post by: Mathias (Author) on January 23, 2014, 12:35:25
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 += "\";

Title: Re: Bugs of CopyFile script function
Post by: Jungle on January 23, 2014, 12:40:48
Indeed, it works with ending path delimiter