[Top][All Lists]

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

Re: file properties cache

From: Ted Zlatanov
Subject: Re: file properties cache
Date: Wed, 31 Jan 2007 16:53:52 -0500
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.92 (gnu/linux)

On 31 Jan 2007, address@hidden wrote:

> Ted Zlatanov <address@hidden> writes:
>> Tramp 2.1.8-pre (from CVS)
>> When I open a file remotely, its properties (specifically, read-only)
>> are cached.  If the attributes are changed on the remote system, I
>> still can't open that file for editing because the properties are
>> cached.  I've coped by clearing the tramp-cache, but perhaps there
>> should be a command to clear the cache for the file currently visited,
>> and that command should be (optionally) executed when the buffer is
>> closed (e.g. with kill-this-buffer).
> Hmm. There's always the ned for balance between a cache and changes
> from somewhere else. If the properties of a file are changed outside
> Emacs, there is no chance the cache can be kept consistent. The same
> problem might appear with ange-ftp, which uses a filec cache as
> well.


> On the other hand, removing file properties every kill-buffer will
> reduce the performance improvement by caching.

Logically, it's unlikely a user will close a buffer unless he 
a) doesn't need it anymore, or b) is trying to lose the file cache :)

> Tramp tries to remove file properties in all cases it detects there is
> a change. If it misses some cases where it should do so, please
> report.

Can you explain what you mean by "detects" so I know where to look for
the bug?  When does Tramp re-run "ls -l" or its equivalent?

> Changing the file properties on a remote host during an Emacs session
> should be rather rare, shouldn't it? 

Perforce (a VCS) checkout of a file makes it +w; checkin makes it -w.
Often I'll open a file that's not checked out for a quick look, then
close it and revisit after it's been checked out on the remote
system.  The effect is the same as chmod +w or -w FILE.

> Anyway, such a function for wiping the properties of a given file
> out of the cache could look like this:
> (defun tramp-flush-file (filename)
> "Remove Tramp properties of remote FILENAME."
> (when (tramp-tramp-file-p filename)
> (with-parsed-tramp-file-name (expand-file-name filename) nil
> (tramp-flush-file-property v localname))))

Thanks.  I can trigger this on buffer kill, but my real concern was
that it's a bug, so I'm fixing the symptom rather than the real


reply via email to

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