SUMMARY When using Synchronizer, files that are linked lose their dates. At least, if a symlink is added to a folder and it's synchronized: after the synchronization, in the destination folder, the corresponding linked file loses its date (and gets the date of the symlink). This is a (fortunately) reproducible problem. STEPS TO REPRODUCE 1) Execution of: mkdir /tmp/source touch /tmp/source/1.txt --date "2011-11-11 11:11:11 +0100" mkdir /tmp/dest cp -a /tmp/source/1.txt /tmp/dest cd /tmp/source ln -s 1.txt 1link.txt 2) Execution of: ls --full-time /tmp/source and ls --full-time /tmp/dest in order to have written information about some dates, for example: $ ls --full-time /tmp/source total 0 lrwxrwxrwx 1 user user 5 2020-01-11 12:28:52.269082028 +0100 1link.txt -> 1.txt -rw-rw-r-- 1 user user 0 2011-11-11 11:11:11.000000000 +0100 1.txt $ ls --full-time /tmp/dest total 0 -rw-rw-r-- 1 user user 0 2011-11-11 11:11:11.000000000 +0100 1.txt 3) Use of Krusader to synchronize /tmp/dest (in the left part) and /tmp/source (in the right part). Note: The only change that Synchronizer suggested was the copy of the symlink. 4) After the synchronization, execution of: ls --full-time /tmp/source and ls --full-time /tmp/dest in order to see what has happened to some dates, for example: $ ls --full-time /tmp/source total 0 lrwxrwxrwx 1 user user 5 2020-01-11 12:28:52.269082028 +0100 1link.txt -> 1.txt -rw-rw-r-- 1 user user 0 2011-11-11 11:11:11.000000000 +0100 1.txt $ ls --full-time /tmp/dest total 0 lrwxrwxrwx 1 user user 5 2020-01-11 12:30:57.833085753 +0100 1link.txt -> 1.txt -rwxrwxrwx 1 user user 0 2020-01-11 12:28:52.000000000 +0100 1.txt Therefore we can see that an existing file (/tmp/dest/1.txt) in the destination folder has lost its date. Note: After the copy, it would also be correct that the date of the copied symlink was the same as its source. OBSERVED RESULT An existing file (/tmp/dest/1.txt) in the destination folder has lost its date. EXPECTED RESULT The "/tmp/dest/1.txt already existing file in the destination folder... shouldn't lose its date. Additionally, it would be better if the date of the copied symlink was the same as its source. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Kubuntu 19.10 and Kubuntu 18.04 LTS KDE Plasma Version: 5.16.5 and 5.12.9 KDE Frameworks Version: 5.62.0 and 5.44.0 Qt Version: 5.12.4 and 5.9.5 ADDITIONAL INFORMATION The problem is possibly related to the `KIO::symlink` lines in synchronizer.cpp.
The problem is possibly related to the `KIO::symlink` lines in synchronizer.cpp, and we have to take into account that it doesn't mean that `KIO::symlink` is flawed. I attach a little KIO example that uses `KIO::symlink` but its execution doesn't show the effects of the bug: Note: The example was based on a program named "tutorial1", from https://techbase.kde.org/Development/Tutorials/First_program/KF5 https://techbase.kde.org/Development/Tutorials/Saving_and_loading/KF5 main.cpp: #include <QApplication> #include <KMessageBox> #include <KIO/Job> int main (int argc, char *argv[]) { QApplication app(argc, argv); KIO::symlink("/tmp/tryOriginal.txt", QUrl("file:///tmp/tryLink.txt"), KIO::Overwrite); KMessageBox::information(NULL, "Press Enter to continue", "Dialog"); } CMakeLists.txt: project (tutorial1) cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) set(QT_MIN_VERSION "5.3.0") set(KF5_MIN_VERSION "5.2.0") find_package(ECM 1.0.0 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) include(KDEInstallDirs) include(KDECMakeSettings) include(KDECompilerSettings) include(FeatureSummary) # Find Qt modules find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core # QCommandLineParser, QStringLiteral Widgets # QApplication ) # Find KDE modules find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS CoreAddons WidgetsAddons # KMessageBox KIO # KIO ) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) set(tutorial1_SRCS main.cpp) add_executable(tutorial1 ${tutorial1_SRCS}) target_link_libraries(tutorial1 Qt5::Widgets KF5::CoreAddons KF5::WidgetsAddons KF5::KIOCore ) install(TARGETS tutorial1 ${INSTALL_TARGETS_DEFAULT_ARGS}) Those steps were followed: $ mkdir build && cd build $ rm /tmp/tryOriginal.txt /tmp/tryLink.txt 2>/dev/null; touch --date "2011-11-11 11:11:11 +0100" /tmp/tryOriginal.txt && cmake .. && make && ./tutorial1; ls -l /tmp/tr* [...] lrwxrwxrwx 1 user user 20 mar 12 12:36 /tmp/tryLink.txt -> /tmp/tryOriginal.txt -rw-rw-r-- 1 user user 0 nov 11 2011 /tmp/tryOriginal.txt and so it could be seen that the date of /tmp/tryOriginal.txt hadn't changed, `KIO::symlink` worked correctly.
Created attachment 127093 [details] Experimental code that keeps dates intact using `cp -a` If it may be helpful when investigating more about the bug, if the attached experimental code is used: - The bug does not happen. - Additionally, the dates of the symlinks that are copied are kept intact. However, the experimental code is aimed to help investigating, not to be a formal solution.
This bug is possibly related to https://bugs.kde.org/show_bug.cgi?id=135996