tramp-devel
[Top][All Lists]
Advanced

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

Re: ange-ftp-get-files is not updating his cache


From: Thierry Volpiatto
Subject: Re: ange-ftp-get-files is not updating his cache
Date: Mon, 09 Jul 2012 18:09:47 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

Thierry Volpiatto <address@hidden> writes:

> Hi,
> it seem that `ange-ftp-get-files' always check the content of his cache
> in hashtable and doesn't update it after first listing.
> Removing the gethash check to `ange-ftp-files-hashtable' fix it.
>
> So I don't understand how this hashtable could be updated when new files
> are copied/removed from the ftp server.
> IMO this code is wrong.

Here is described the problem:

--8<---------------cut here---------------start------------->8---
ange-ftp-reread-directory

Reread remote directory DIR to update the directory cache.
The implementation of remote FTP file names caches directory contents
for speed.  Therefore, when new remote files are created, Emacs
may not know they exist.  You can use this command to reread a specific
directory, so that Emacs will know its current contents.
--8<---------------cut here---------------end--------------->8---

So actually when some files have been copied or removed, one should
reread the ftp directory to update cache.

This should been done automatically isn't it?

I have fixed this in helm by doing this before listing a directory:

--8<---------------cut here---------------start------------->8---
  ;; Always reread ftp directory, otherwise we will never be aware
  ;; of new or deleted files.
  (when (eq 'ftp (file-remote-p directory 'method))
    (setq ange-ftp-ls-cache-file nil)
    (remhash directory ange-ftp-files-hashtable))
--8<---------------cut here---------------end--------------->8---


-- 
  Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




reply via email to

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