- # If we don't own the cache dir, using it will either fail or
- # (if we're root) pollute it so other processes fail later.
- STDERR.puts("Defaulting to memory cache, because #{default_cache_path} " \
- "owner (uid=#{File::Stat.new(default_cache_path).uid}) " \
- "is not me (uid=#{Process.euid})")
+ if File.exist?(default_cache_path)
+ why = "owner (uid=#{File::Stat.new(default_cache_path).uid}) " +
+ "is not me (uid=#{Process.euid})"
+ else
+ why = "does not exist"
+ end
+ STDERR.puts("Defaulting to memory cache, " +
+ "because #{default_cache_path} #{why}")