Compare Files & Delete

Discuss and share scripts and script files...
CookieMonster

Re: Compare Files & Delete

Post 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.

highend
Posts: 14942
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Compare Files & Delete

Post 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.
One of my scripts helped you out? Please donate via Paypal

CookieMonster

Re: Compare Files & Delete

Post 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.

CookieMonster

Re: Compare Files & Delete

Post by CookieMonster »

Can you show me the script in action as a video, as it's working for you.

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

Re: Compare Files & Delete

Post by admin »

holy shit... :whistle: :mrgreen:

CookieMonster

Re: Compare Files & Delete

Post 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.

highend
Posts: 14942
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Compare Files & Delete

Post 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.
One of my scripts helped you out? Please donate via Paypal

CookieMonster

Re: Compare Files & Delete

Post by CookieMonster »

The only way was to show in a demonstration, I hope we can find a solution :)

Biggynuff
Posts: 110
Joined: 13 May 2010 14:08

Re: Compare Files & Delete

Post 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:

highend
Posts: 14942
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Compare Files & Delete

Post 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
One of my scripts helped you out? Please donate via Paypal

Post Reply