| 295 | class TmpDirFileSystem : public NullFileSystem { |
| 296 | public: |
| 297 | Status FileExists(const string& dir) override { |
| 298 | StringPiece scheme, host, path; |
| 299 | io::ParseURI(dir, &scheme, &host, &path); |
| 300 | if (path.empty()) return errors::NotFound(dir, " not found"); |
| 301 | // The special "flushed" file exists only if the filesystem's caches have |
| 302 | // been flushed. |
| 303 | if (path == "/flushed") { |
| 304 | if (flushed_) { |
| 305 | return Status::OK(); |
| 306 | } else { |
| 307 | return errors::NotFound("FlushCaches() not called yet"); |
| 308 | } |
| 309 | } |
| 310 | return Env::Default()->FileExists(io::JoinPath(BaseDir(), path)); |
| 311 | } |
| 312 | |
| 313 | Status CreateDir(const string& dir) override { |
| 314 | StringPiece scheme, host, path; |