[Top][All Lists]

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

Re: iterating over a list while removing elements

From: Eli Zaretskii
Subject: Re: iterating over a list while removing elements
Date: Thu, 20 Mar 2014 22:16:25 +0200

> From: lee <address@hidden>
> Date: Thu, 20 Mar 2014 18:34:58 +0100
> Joost Kremers <address@hidden> writes:
> > Note, BTW, that file-directory-p returns t for "." and "..". It seems to
> > me that the only two names that directory-files could return that you
> > really want to exclude are those two,[1] so there's no need for
> > multisearch-directory-ref-p, I think. (Or is there?)
> The idea is that (file-directory-p "..") may cause a file look-up which
> can be avoided by string-matching.

After you've read the directory, its entries, including "..", are in
the cache, so (file-directory-p "..") should not need to hit the disk.

> How does the disk cache deal with non-existing files?  The
> meta-information is probably in the cache (more or less), yet there can
> be no information for non-existing files.

Non-existing files are missing entries in their parent directories,
which are files by themselves, and thus cached.  So dealing with
non-existing files just means reading their directory (from memory,
not from disk) and noticing that a file by that name is not there.

reply via email to

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