External Copy Handlers

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

:info: Please Include The Following Information
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: Use Your Profile Or Signature
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
Post Reply
TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

External Copy Handlers

Post by TheQwerty »

Maybe more questions than issues, especially since I don't use either handler and those that do should have caught if this is actually a problem.

It looks to me like XY is not properly quoting the destination - either forgetting the opening quotes or adding superfluous trailing quotes. Is this correct?

Also, is it expected that unlike the TeraCopy source file the one generated for FastCopy does not include the LE BOM (0xFFFE)?



How I came to question the quoting...

I was curious about this new feature so I used a simple C program, ShowArgs.exe (source below), which outputs the command line arguments to experiment a bit, and in a fresh copy of 13.50 I enabled Custom Copy and added the following:

Code: Select all

FastCopy|ShowArgs.exe|copy_args|move_args
TeraCopy|ShowArgs.exe|copy_args|move_args
My experimenting consisted of right-dragging 'C:\Test\New Text File.txt' to 'C:\Test\New Folder' and selecting Copy or Move Here.

With FastCopy|ShowArgs.exe|copy_args|move_args:
Copy Here wrote:1: C:\Zen\Apps\XYplorer\ShowArgs.exe
2: /cmd=diff
3: /srcfile_w=C:\Users\TheQwerty\AppData\Roaming\FastCopy\FileList.txt
4: copy_args
5: /to=C:\Test\New Folder"
Move Here wrote:1: C:\Zen\Apps\XYplorer\ShowArgs.exe
2: /cmd=move
3: /srcfile_w=C:\Users\TheQwerty\AppData\Roaming\FastCopy\FileList.txt
4: move_args
5: /to=C:\Test\New Folder"
With TeraCopy|ShowArgs.exe|copy_args|move_args:
Copy Here wrote:1: C:\Zen\Apps\XYplorer\ShowArgs.exe
2: copy
3: *C:\Users\TheQwerty\AppData\Roaming\TeraCopy\FileList.txt
4: C:\Test\New Folder" copy_args
Move Here wrote:1: C:\Zen\Apps\XYplorer\ShowArgs.exe
2: move
3: *C:\Users\TheQwerty\AppData\Roaming\TeraCopy\FileList.txt
4: C:\Test\New Folder" move_args
Renaming the destination to 'C:\Test\Folder' had similar results.


Various Information wrote:XYplorer: 13.50.0000 (Pro Edition - Lifetime License Pro)
Loaded in: 520 ms at 12/17/2013 7:54:03 AM
Uptime: 21 mins, 32 secs
Memory Usage: 39,404 KB, Virtual Memory Size: 19,392 KB

OS: Windows 7 Professional (Service Pack 1), 64-bit (6.1)
OS Uptime: 27 days, 15 hrs, 52 mins, 11 secs
UTC Offset: --05:00
User Role: User
Themes: Yes (Aero)

System Locale ID: 1033 (en-US)
Thread Locale ID: 1033 (en-US)
Default ANSI Code Page: 1252 (ANSI - Latin I)
Active Code Page: 1252 (ANSI - Latin I)
DBCS Code Page: No


Source of ShowArgs.exe

Code: Select all

#include <stdio.h>

int main(int argc, char *argv[])
{
	int x = 0;
	for (x = 0; x < argc; x++)
	{
		printf("%d: %s\n", x+1, argv[x]);
	}

	printf("\nPress any key to continue...\n");
	getchar();
	
	return 0;
}
[/size]

admin
Site Admin
Posts: 67282
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: External Copy Handlers

Post by admin »

TheQwerty wrote:Also, is it expected that unlike the TeraCopy source file the one generated for FastCopy does not include the LE BOM (0xFFFE)?
Yep. Took me some trial and error to find out that FastCopy does not like the BOM.

I cannot confirm your quoting issue. Tested it with my own command line tester. Looks alright.

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: External Copy Handlers

Post by TheQwerty »

admin wrote:I cannot confirm your quoting issue. Tested it with my own command line tester. Looks alright.
Seems the crazy quoting I see is because of Microsoft's ugly smartness and fun rules.

Which in their own way makes some sense.

I'd guess your tester is either in VB or retrieving the arguments in a way that avoids Microsoft's CommandLineToArgv* / _setargv.


That said, I think there might still be an issue with the arguments XY passes since the destination path includes the trailing backslash and is quoted, thus requiring the handlers to be aware of Microsoft's smartness or be lenient on accepting trailing quotes. Would it be prudent for XY to just strip the trailing backslash?

admin
Site Admin
Posts: 67282
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: External Copy Handlers

Post by admin »

Yes, that's a VB proggy.

Would the problem disappear if I unslashed the target path? Probably... the trailing \" seems to be the problem.

Nevertheless, it seems to work as it is.

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: External Copy Handlers

Post by TheQwerty »

At least worth noting if you ever add another handler or get reports of one of the current ones exhibiting some odd behavior with future versions.

I was really just looking for ways this could be abused for other uses - can't say I came up with any worthwhile ideas though. :whistle:


I'm also shocked that the forum let you get away with releasing this without custom icons - or at least displaying the handler's executable's icon in the toolbar button menu / configuration drop-down. We must be snoozing with the approaching holidays! ;) :lol:

admin
Site Admin
Posts: 67282
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: External Copy Handlers

Post by admin »

TheQwerty wrote:At least worth noting if you ever add another handler or get reports of one of the current ones exhibiting some odd behavior with future versions.

I was really just looking for ways this could be abused for other uses - can't say I came up with any worthwhile ideas though. :whistle:


I'm also shocked that the forum let you get away with releasing this without custom icons - or at least displaying the handler's executable's icon in the toolbar button menu / configuration drop-down. We must be snoozing with the approaching holidays! ;) :lol:
1. Yes.
2. You will find ways, I'm sure.
3. Thank me for it. The icon of FastCopy is a disaster. (Can it really be Japanese?)

Enternal
Posts: 1175
Joined: 10 Jan 2012 18:26

Re: External Copy Handlers

Post by Enternal »

Oooh! Thanks TheQwerty for the command line tester. I also have my own version written in PureBasic but it's also nice to have a C++ version heh.
admin wrote:3. Thank me for it. The icon of FastCopy is a disaster. (Can it really be Japanese?)
The guy wrote everything from scratch and that includes the icons and we can clearly see how horrible it is haha. To be honest, he obviously is not the best when it comes to graphics because I always thought his interface was... ugly. On the other hand, somehow it looks fast (and is fast) so not a bad thing.

EDIT: Now testing with my tool, I think one of the "problem" is that this is not truly portable in that it creates a file in the AppData. Looking at the command line arguments with my own tester:

Code: Select all

/cmd=diff /srcfile_w="C:\Users\User\AppData\Roaming\FastCopy\FileList.txt" /cmd=noexist_only /open_window /estimate /no_exec /verify /to="C:\Users\User\Desktop\"
Perhaps you should make the file within the same directory where the executable is located. If it's not writable, THEN you would write in AppData or perhaps the Temp folder would be better. Don't like leaving these files hanging around when you don't need them. Also just in case, unlike TeraCopy where you have to provide a file with source list, FastCopy can simply provide a single line with space as the delimiter. Basically: fastcopy.exe [/options] file1 file2 file3 [/to=dest_dir]

Borut
Posts: 1472
Joined: 19 Oct 2010 19:29
Location: Win10 Pro 64b 22H2, @120DPI (125%)

Re: External Copy Handlers

Post by Borut »

As far as I can see (but I might be wrong), FastCopy with /cmd=move actually copies the object(s) and then deletes the originals. Well, this is not what I wanted.

So, I would be much happier if XYplorer would be able to associate copy handlers per action type (copy, move). Then one could be able to define, for instance:

When copying, use external handler FastCopy
When moving, use custom copy

This idea seems not to fit in the current concept at all, unfortunately.

Also, I was not aware of the fact that the objects-to-be-copied-list file is being stored permanently somewhere. Definitely not nice, IMHO. I would be happy to be able to define explicitly a directory for such things and what to do with its contents when closing XYplorer (nothing, delete, nuke).

BTW, yes, with FastCopy one can use the command line parameter for specifying objects directly, but the command line it is of finite length and hence not usable for long object lists (even my own script still uses this and consequently fails with long lists, as it seems).

So, file with the list is OK, but not without having control over it.

EDIT: This is of course more of a wish than a bug, actually.
Win 10 Pro 64bit

Enternal
Posts: 1175
Joined: 10 Jan 2012 18:26

Re: External Copy Handlers

Post by Enternal »

Borut wrote:As far as I can see (but I might be wrong), FastCopy with /cmd=move actually copies the object(s) and then deletes the originals. Well, this is not what I wanted.
What do you mean by this? It's in a way a "safety" feature so in case something goes wrong, your original was never touched. You can see this type of feature in a lot of other types of applications especially backup software.

Oh yes! I forgot that there is a finite length to how much you can specify (encountered in a couple times when writing scripts and such) so I guess the lists is fine but I hope it's more "portable" than it currently is.

I do like your wish Borut but it feels... a bit complicated. Since you could just select which Custom Copier from the list you want to use anyway.

admin
Site Admin
Posts: 67282
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: External Copy Handlers

Post by admin »

I agree with (almost) everything. :)

1) Will use Temp folder for the FileList.txt.
2) Will delete it when XY closes.
3) Well, I could offer which operation (Move, Copy, Backup) actually uses the external copy handler. But the interface is a problem. The icon is either brown (don't) or green (do). Should I add a third color for "maybe"? Hm, not so good. What I will add in any case: [ ] Use it also for backup operations. One also could think of an option [ ] Ask (would offer the list of copy handlers before every operation) ... well, might be overkill.
4) FYI, I had decided to always use FileList.txt because I thought people would typically use these handlers for big jobs, and because it's just easier to have one solution for all cases.

Borut
Posts: 1472
Joined: 19 Oct 2010 19:29
Location: Win10 Pro 64b 22H2, @120DPI (125%)

Re: External Copy Handlers

Post by Borut »

@Enternal

If I want to move some File.txt from X:\Folder1\ into X:\Folder2\ then I do not want to copy anything. I want to move (=OS manipulates the file system tables and does not move any data blocks) and I do not need any security. Maybe there is an option to achieve this mode of operation with FastCopy and I missed it?

@Don
Hm, yes, I felt that it is a kind of a UI mess. But, it gets even more complex. I see this:

Copiers:
O OS
C Custom
F FastCopy
T TerraCopy
...

Operations:
P Copy
S Same drive move
M Different drive move

Copier Use Table, for example:

For P: F
For S: C
For M: F
Win 10 Pro 64bit

admin
Site Admin
Posts: 67282
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: External Copy Handlers

Post by admin »

Complex but controllable. I see no real problem here.

You configure:
1) Shell or conditional Custom
2) If conditions for using Custom met:
3) Custom or conditional External
4) If conditions for using External met:
5) Which External

Flow:
1) Shell OR Custom
2)                 |
3)    Custom OR External
4)                           |
5)           FastCopy OR TeraCopy

Post Reply