tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tramp-cache and destructive operations


From: Jürgen Hötzel
Subject: Re: tramp-cache and destructive operations
Date: Thu, 13 Aug 2015 08:56:32 +0200

Hi Michael,

On Wed, Aug 12, 2015 at 9:09 PM, Michael Albinus <address@hidden> wrote:

tramp-cache does not care about the object you cache. Often, it is not a
list but a simple value, like a string.

If you cache a list, the hash keeps just the entry to that list. If you
use that list, and it is modified somewhere else, it is not the duty of
tramp-cache to prevent this.

So yes, using `copy-sequence' in
`tramp-adb-handle-directory-files-and-attributes' seems to be TRT.


Makes sense. I wasn't aware of possible side effects when implementing 
 `tramp-adb-handle-directory-files-and-attributes' back in 2011. 

Another approach could be to change the implementation and to cache
another list, which is used then to assemble the result of
`tramp-adb-handle-directory-files-and-attributes'. See the cache entries
when evalling `tramp-handle-directory-files-and-attributes', which uses
the cache entry for "file-name-all-completions", IIRC.

> Thanks,
>
> Jürgen

Best regards, Michael.

Thank you for your detailed explanations!

Jürgen

reply via email to

[Prev in Thread] Current Thread [Next in Thread]