Created attachment 140818 [details] Example SUMMARY When a file is missing in one folder, while comparing both, saving fails when the file needs to be created. STEPS TO REPRODUCE 1. Extract the example attachment 2. Compare the folders 3. Apply the diff output, so that "problem.txt" should be created in the other folder 4. Save OBSERVED RESULT It fails to copy the finished file from the tmp directory to the (non existing) destination. EXPECTED RESULT It should save. SOFTWARE/OS VERSIONS Operating System: Garuda Linux KDE Plasma Version: 5.22.4 KDE Frameworks Version: 5.85.0 Qt Version: 5.15.2 Kernel Version: 5.13.10-zen1-1-zen (64-bit) Graphics Platform: X11 ADDITIONAL INFORMATION This took me so long to figure out; I thought Kompare was really broken...
Well, if the file does not exist in one of the folders, diff does the comparison with /dev/null instead. Obviously, you cannot save to /dev/null.
(In reply to Kevin Kofler from comment #1) > Well, if the file does not exist in one of the folders, diff does the > comparison with /dev/null instead. Obviously, you cannot save to /dev/null. I was still hoping, that it would just create the file - I mean the file exists in the tmp directory, but kompare just fails to copy (replace) it into the target folder...
Looks like there was some actual breakage in the code here, see the proposed fix at: https://invent.kde.org/sdk/libkomparediff2/-/merge_requests/2
Git commit f465f1a36fab13087778258e9db9569f112b6818 by Carl Schwan, on behalf of Demitrius Belai. Committed on 13/03/2022 at 22:18. Pushed by carlschwan into branch 'master'. Fix directory creation on destination When a file not exists on destination directory, Kompare needs to create it. However, Kompare creates a directory instead. Related: bug 126870 M +3 -2 src/komparemodellist.cpp https://invent.kde.org/sdk/libkomparediff2/commit/f465f1a36fab13087778258e9db9569f112b6818