[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#58842: 29.0.50/tramp; copy-file KEEP-TIME gives the target earlier t
From: |
Sam Steingold |
Subject: |
bug#58842: 29.0.50/tramp; copy-file KEEP-TIME gives the target earlier time |
Date: |
Mon, 31 Oct 2022 11:33:13 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Hi Michael,
> * Michael Albinus <zvpunry.nyovahf@tzk.qr> [2022-10-30 16:42:21 +0100]:
>
> Sam Steingold <sds@gnu.org> writes:
>
>> One property of `copy-file' that I came to expect is:
>>
>> (copy-file src dst ...) is successful
>> ==>
>> (file-newer-than-file-p src dst) is false
>>
>> This ensures that the same file is not copied over and over.
>>
>> Alas, this does not hold in the following corner case:
>>
>> 1. src is local on mac
>> 2. dst is remote on linux
>> 3. KEEP-TIME is passed to `copy-file'
>>
>> In this case, after `(copy-file src dst t t)`,
>>
>> (file-attribute-modification-time (file-attributes dst))
>> => (25435 65247 0 0)
>> (file-attribute-modification-time (file-attributes src))
>> => (25435 65247 279367 729000)
>>
>
> Well, another fix would be to teach file-newer-than-file-p to use only
> seconds w/o fractions. Does the appended patch works for you?
>
Yes, thank you, it does appear to fix the issue.
Please note a typo in the comment in your patch.
--
Sam Steingold (https://aphar.dreamwidth.org/) on darwin Ns 10.3.2113
https://lastingimpactpsychology.com https://steingoldpsychology.com
https://fairforall.org http://think-israel.org https://www.dhimmitude.org
Two wrongs don't make a right, but three rights make a left.