Page 2 of 2

Re: Compare Files & Delete

Posted: 21 Jul 2013 18:56
by CookieMonster
highend wrote:Not the script is slow, the computation of the md5 hashes is slow. Because XY does not support threading the entire application locks up while performing the hash calculations.

Just set the first variable to an empty string:

Code: Select all

$hash = "";
Nothing more can be done to make it faster (apart from not using bytewise comparison and instead relying on file times, size, etc.).
Didn't work. Continues to take almost :30 minutes, then when it is finished, and I choose to delete anything in the active / inactive pane, it prompts me, there is nothing to delete.

Re: Compare Files & Delete

Posted: 21 Jul 2013 20:07
by highend
I already gave you two options (status command / step) to see, why it's not working as it should.

Comparing two 3gb files on two partitions on my ssds is nearly instant ($hash = "") and the script is working flawlessly for me.

Re: Compare Files & Delete

Posted: 21 Jul 2013 20:45
by CookieMonster

Code: Select all

  foreach ($file, $processList, "|") {
          status "Processing file: $file", , "progress";
          if (strpos($haystackList, $file) != -1) {
I added this code, and the status, it starts with the first file, from top, down, and doesn't go though the rest of the files. I'm comparing files between an External HDD and a Platter HDD, no SSD !

Edit: The script is way faster then it was after doing the script edit.

Re: Compare Files & Delete

Posted: 24 Jul 2013 18:02
by CookieMonster
Can you show me the script in action as a video, as it's working for you.

Re: Compare Files & Delete

Posted: 24 Jul 2013 18:29
by admin
holy shit... :whistle: :mrgreen:

Re: Compare Files & Delete

Posted: 24 Jul 2013 18:39
by CookieMonster
The script worked on, one file. After what felt like I was fighting with it, the point of the video is to compare.

Re: Compare Files & Delete

Posted: 25 Jul 2013 20:00
by highend
Sorry, more important things to do than capturing videos for file comparing...

1. When you think that the first version of the script is faster than the generic one, just use that (I don't see any differences that makes the first one faster but anyway...)

2. What takes time is the filesequal() command. If it takes too long, just rewrite it to compare e.g. size, created + last modified time to see if files are different.

Re: Compare Files & Delete

Posted: 26 Jul 2013 05:08
by CookieMonster
The only way was to show in a demonstration, I hope we can find a solution :)

Re: Compare Files & Delete

Posted: 03 Aug 2013 14:39
by Biggynuff
highend,

This script is beautiful! Thank you very much. :appl:

I've added it to a toolbar button I use with a collection of useful scripts.

XY completely rocks :shock: 8) 8) :shock:

Re: Compare Files & Delete

Posted: 03 Aug 2013 15:32
by highend
Thanks.

I'll upload a new version later today / tomorrow.

If $showFilesBeforeDelete is set to 1 (default), you'll get a list of files in a text popup (the selection takes place as well).
It's also able to show exactly which files are missing (in comparison to the other pane).

Apart from that it allows to compare manually selected files as well (the current version will use all files on both panes).

Made a new topic for the improved script.
See: http://www.xyplorer.com/xyfc/viewtopic.php?f=7&t=10044