Cached IsPath

TanayLabUtilities.CachedIsPath Module

Wrap ispath with a cache such that repeated calls do not go to the OS. This greatly speeds up operations when working with NFS data.

Note

The code here is thread-safe.

TanayLabUtilities.CachedIsPath.cached_ispath Function
cached_ispath(path::AbstractString)::Bool

Same as ispath , except that if less than IS_PATH_CACHE_TIMEOUT_NS has passed since the last time cached_ispath was called for the same path, we reuse the result. If IS_PATH_CACHE_TIMEOUT_NS is zero, this ignores the cache and simply calls ispath .

Note

Do not pass this a path that ends with a / , or the empty string. We actually cache the list of files in the directory, since this gives much faster results when checking for multiple files in the same directory.

TanayLabUtilities.CachedIsPath.empty_ispath_cache! Function
empty_ispath_cache!(path::Maybe{AbstractString} = nothing)::Nothing

Empty the cached_ispath cache. If a path is specified, only clears the cached entry for this path (and every other file in the same directory).

Index