Bug 372768 - Files not copied after skipping directory
Summary: Files not copied after skipping directory
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 5.28.0
Platform: openSUSE Linux
: NOR major
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-22 01:56 UTC by contact
Modified: 2025-03-25 00:47 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Directory / file structure to test (1.39 KB, application/zip)
2022-10-27 03:42 UTC, contact
Details

Note You need to log in before you can comment on or make changes to this bug.
Description contact 2016-11-22 01:56:41 UTC
1. Start with a directory structure like the following in two places (e.g. home and on a flash drive for backups, or two different directories in home) that I'll call D1/ and D2/:
projects/
  project/
    (potentially some files)
  project 2/
    (potentially more files)
  project 3.txt

2. Copy D1/projects/ to D2/ (copy-paste or drag-drop both behave the same)
3. Get a "Folder already exists" dialog for projects/, and choose "Write Into"
4. Get a "Folder already exists" for projects/project/, and choose "Skip"
5. Fail to get any "Folder already exists" dialog for projects/project 2/ or "File already exists" dialog for projects/project 3.txt, and neither are copied.

Steps 2 and 3 can be replaced with simply copying D1/projects/* to D2/projects/. I've tried this in Dolphin, although it will probably happen in anything else using KIO.

I did a little digging into the cause, and it seems to be because directory paths in CopyJobPrivate::m_skipList sometimes don't have a trailing slash – CopyJobPrivate::shouldSkip() is checking for paths that start with a path in m_skipList, and without the slash it matches anything similarly named instead of just that particular directory's contents. CopyJobPrivate::slotResultCreatingDirs() adds the slash if needed before adding a path to m_skipList, while CopyJobPrivate::slotResultConflictCreatingDirs() does not.
Comment 1 Justin Zobel 2022-10-27 02:48:38 UTC
Thank you for reporting this bug in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 2 contact 2022-10-27 03:41:34 UTC
Yes, still happens on an up-to-date system (openSUSE Tumbleweed 20221023, KDE Plasma 5.26.1, Dolphin 22.08.2, KDE Frameworks 5.99.0, Qt 5.15.6). I'll also attach an example directory structure to hopefully make any testing easier.
Comment 3 contact 2022-10-27 03:42:27 UTC
Created attachment 153231 [details]
Directory / file structure to test
Comment 4 contact 2025-03-25 00:47:02 UTC
Just thought I'd check if this is still happening, and it seems to be fixed on my system.

Operating System: openSUSE Tumbleweed 20250319
KDE Plasma Version: 6.3.3
KDE Frameworks Version: 6.12.0
Qt Version: 6.8.2
Kernel Version: 6.13.6-1-default (64-bit)
Dolphin version: 24.12.3