Copy files with comparison?

Is it possible to add a copying option with comparison?
For example, if a copying error occurs, a broken file may remain, and when you need to copy 500+ files, it is difficult to find one broken file.
The program offers to either overwrite all files or skip all files.
But where is the option to skip different files by content, and not by date.
The program thinks that a broken and a non-broken file are the same if you select “skip the same”.

Is it possible to somehow improve the work with files “out of the box”, without climbing into the terminal.
I am generally surprised why this function was not introduced earlier.

1 Like

Hi! For what it’s worth, there are a couple of existing feature requests in the KDE Bugtracking System for Dolphin (via the underlying KIO components) that relate to having additional options when determining what to copy or overwrite:

Given the possibility of losing data when something goes wrong, these would be features requiring both high confidence in the underlying code, and extreme clarity in how choices are presented to the user. If you’d like a bit of context on recent discussions about how to present file overwriting choices, the merge request for the most recent change is here: Redesign rename/overwrite dialog (!1464) · Merge requests · Frameworks / KIO · GitLab

Are there other methods - beyond hash and size comparisons - that folks maybe haven’t brought up yet, but that might be helpful in determining when to overwrite?

1 Like

I know this is not what you are asking for but when I need to copy that many files I always go for a sync type solution rather than simple copying.

The primary advantage is that it doesn’t need to transfer files that are already present at the target location.
So when you have to do it repeatedly, e.g. because an earlier attempt got interrupted, it will sort of “continue” instead of restarting.

My personal approach is using rsync in a Konsole session but there are also UI frontends such as Grsync.

You could give that a try and see if it works for you

1 Like

The second reason to do sync is of in the process of copying a partial file is put in the second location when you resume sync it will be noted, deleted, and replaced with the correct copy. I personally recommend FreeFileSync set to mirror and to out and out delete removed files. I run it almost daily.

1 Like

For this dialog, you need to check the files manually, that is, click through 500+ files, looking at this line of “individuality”, not very convenient.

:writing_hand:
Thank you. This is of course good.
But this is a fact-check.
But I would like a built-in function, instead of installing a bunch of additional software that is not as convenient as Dolphin

Yes, of course.

I was just pointing out that if you use case is to keep a second directory up to date with another one then syncing is the way to go.

It avoids duplication and, as @BlueUSA said, will also delete files that no are no longer present at the source.

Copying, by comparison, is like sync to an empty target.

Now I am wondering if there is a way to incorporate synching into Dolphin additional to copying.

The screenshot does not show but in case you have many files it will offer “overwrite older files”

Extending this has been on my radar, but benevolent time is limited.

3 Likes

That’s the problem. These are not old files.
These are new files.
It leaves a broken new file and does not replace it with a normal one.
Well, I don’t know, imagine that I have 4tb of files and out of 100,000 pieces.
I just want to copy them from one directory to another.
But during the copying process an error occurs (especially relevant for NTFS) and broken files remain.
And I don’t remember which file exactly ended with an error.
I do “copy” again and “skip already copied files” (and the broken one is newer than the old one) and that’s it. I have somewhere in 100,000 - 1 broken one.

And this situation could have been avoided if there was a synchronization function here.

Don’t even suggest a console for working with a directory tree and a larger volume of files, when you need to understand what is what, sort by type and so on - it’s not convenient.

Ah, that is definitely what I would consider a sync case.

Could preliminarily done with a service menu but could probably be another option in the paste/drop menu on the target.

I.e. like “Copy here” a “Sync to here”

That’s what rsync was invented for. If you don’t want to use a terminal directly, there are several options:

Grsync adds a GUI to rsync

You can write a shell script and link it to a .desktop file that you can add to your launcher or as a desktop/panel icon. This script can use a dialog manager such as Kdialog, yad, or Zenity for GUI interaction (it’s easy to do). These support a lot of different types of dialogs including file choosers so a lot of the work is already done for you.

You can also add such a script as a File type option (in the properties dialog) for files that match a pattern and add an argument such as %f, so if you right click on a flie in Dolphin and select your script, its name is passed to your script.

Also check the rsync option --checksum which will validate every file’s content is an exact match.

1 Like

easy? What do you mean easy? I’m not a programmer.
At the same time, I don’t understand why not add functionality and expand functionality?
Why does each Administrator have to do everything their own way and everything from scratch? That is, without clinging to each other and reaching out.
And you only yell from above “it’s so easy” why haven’t you climbed in yet?
And if it’s so easy - write 2 lines of code and insert it into the program then initially.
So that you don’t have to run around hundreds of forums and search - how to insert obvious things that should be there initially.

Joseph’s primary suggestion was to use an app specifically designed for the use case at hand.

Then followed up with an idea on how to achieve the task without such an app.
That idea requires some sort of helper program, potentially a script, that is called via Dolphin’s service menu facility.

After all this is the brainstorming section :slight_smile:

2 Likes

Sorry, when you said you didn’t “want” to use a terminal, I thought that it was a option and you just didn’t want to have to do it. The “easy” part referred to adding the GUI part to a script assuming you already knew enough to write the initial script.

People here have wildly different levels of expertise, so it’s hard to know what level to answer some questions with.

Also, because there’s a workaround doesn’t mean that a problem is invalid or shoudn’t be addressed. It just means there’s a way forward in the mean time.

Writing little helper scripts like this can really enhance the usabiity of your system. If you have a very basic knowedge of scripting, they are relatively short and easy to write. I use several regularly. Because they are relatively simple, it also makes it a bit easier to enlist the help of someone skilled to make one for you.