Author Topic: Bugs of CopyFile script function  (Read 9270 times)

Jungle

  • Contributor
  • VIP Member
  • *****
  • Posts: 527
  • Old Skull
    • View Profile
Bugs of CopyFile script function
« 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;
« Last Edit: January 23, 2014, 12:26:26 by Jungle »

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4364
    • View Profile
    • Multi Commander
Re: Bugs of CopyFile script function
« Reply #1 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 += "\";


Jungle

  • Contributor
  • VIP Member
  • *****
  • Posts: 527
  • Old Skull
    • View Profile
Re: Bugs of CopyFile script function
« Reply #2 on: January 23, 2014, 12:40:48 »
Indeed, it works with ending path delimiter