https://bugs.kde.org/show_bug.cgi?id=523767

--- Comment #5 from Toni Asensi Esteve <[email protected]> ---
Maybe this can help:

On
<https://invent.kde.org/utilities/krusader/-/blob/master/app/Synchronizer/synchronizer.cpp>
we can see some source code that Krusader's Synchronizer uses in order to copy
files:
    ```
    KIO::FileCopyJob *job =
        KIO::file_copy(rightURL, destURL, -1, ((overWrite || task->overWrite())
? KIO::Overwrite : KIO::DefaultFlags) | KIO::HideProgressInfo);
    connect(job, SIGNAL(processedSize(KJob *, qulonglong)), this,
SLOT(slotProcessedSize(KJob *, qulonglong)));
    connect(job, &KIO::FileCopyJob::result, this,
&Synchronizer::slotTaskFinished);
    ```
and in `void Synchronizer::slotTaskFinished(KJob *job)` this is used:
    ```
    struct utimbuf timestamp;
    ```
About that `utimbuf`, it has "a resolution of 1 second" and an alternative has
"a precision of 1 microsecond" (according to
<https://linux.die.net/man/2/utime>):
    ```
    The _utimbuf_ structure is:

    struct utimbuf {
        time_t actime;       /* access time */
        time_t modtime;      /* modification time */
    };

    The **utime**() system call allows specification of timestamps with a
resolution of 1 second.

    The **utimes**() system call is similar, but the _times_ argument refers to
an array rather than a structure. The elements of this array are _timeval_
structures, which allow a precision of 1 microsecond for specifying timestamps.
The _timeval_ structure is:

    struct timeval {
        long tv_sec;        /* seconds */
        long tv_usec;       /* microseconds */
    };

    _times_[0] specifies the new access time, and _times_[1] specifies the new
modification time. If _times_ is NULL, then analogously to **utime**(), the
access and modification times of the file are set to the current time.
    ```

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to