[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: recentf-cleanup, file-readable-p & remote files
From: |
David PONCE |
Subject: |
Re: recentf-cleanup, file-readable-p & remote files |
Date: |
Thu, 18 Sep 2003 10:48:04 +0200 (CEST) |
Hi,
> Ah, I think you misunderstood part of what I was trying to say --
> which is that `file-readable-p' can be very slow when you *are*
> connected (when I'm not connected it returns in a fraction of second,
> so that's not a problem)
>
> The reason is that that ange-ftp implements it rather inefficiently.
> Instead of just listing the file in question it lists *all* files in
> the directory. That's a lot of data if the directory contains
> thousands of files. In the example from my previous post doing
> `file-readable-p' is ~500 times slower than actually fetching the
> file!
OK, thank you for the explanation, I understand better now!
Could you try file-exists-p please? Does it work better?
A possibility could be to consider that remote files are always
readable and change `recentf-file-readable-p' like this:
(defsubst recentf-file-readable-p (filename)
"Return t if file FILENAME exists and you can read it.
Assume that remote files are always readable."
(or (file-remote-p filename)
(file-readable-p filename)))
Remote files then could be manually removed from the recent list (M-x
recentf-edit-list), or will be removed naturally by the LRU mechanism
if they are not accessed for a long time (see the option
`recentf-max-saved-items').
Perhaps, in your case, another acceptable workaround could be to
disable the `recentf-auto-cleanup' feature (customize this option to
`never'), and let the LRU mechanism eliminate files not accessed for a
long time.
Thoughts?
David
- Re: recentf-cleanup, file-readable-p & remote files,
David PONCE <=