19 #ifndef PAGESPEED_KERNEL_BASE_STDIO_FILE_SYSTEM_H_
20 #define PAGESPEED_KERNEL_BASE_STDIO_FILE_SYSTEM_H_
29 namespace net_instaweb {
41 virtual InputFile* OpenInputFile(
const char* filename,
46 virtual OutputFile* OpenTempFileHelper(
const StringPiece& prefix_name,
49 virtual bool ListContents(
const StringPiece& dir, StringVector* files,
54 virtual bool RenameFileHelper(
const char* old_file,
const char* new_file,
57 virtual bool Atime(
const StringPiece& path, int64* timestamp_sec,
59 virtual bool Mtime(
const StringPiece& path, int64* timestamp_sec,
64 virtual bool Size(
const StringPiece& path, int64* size,
85 void TrackTiming(int64 slow_file_latency_threshold_us,
Timer* timer,
89 void EndTimer(
const char* filename,
const char* operation, int64 start_us);
93 bool Stat(
const StringPiece& path,
struct stat* statbuf,
96 int64 slow_file_latency_threshold_us_;
virtual bool RemoveFile(const char *filename, MessageHandler *handler)
Like POSIX 'rm'.
virtual bool Unlock(const StringPiece &lock_name, MessageHandler *handler)
virtual bool MakeDir(const char *directory_path, MessageHandler *handler)
Definition: file_system.h:35
Definition: statistics.h:43
virtual bool RemoveDir(const char *directory_path, MessageHandler *handler)
Like POSIX 'rmdir', remove a directory only if it is empty.
virtual int MaxPathLength(const StringPiece &base) const
Definition: stdio_file_system.h:34
Base class for implementations of monitoring statistics.
Definition: statistics.h:342
virtual bool Atime(const StringPiece &path, int64 *timestamp_sec, MessageHandler *handler)
virtual BoolOrError TryLock(const StringPiece &lock_name, MessageHandler *handler)
virtual bool Size(const StringPiece &path, int64 *size, MessageHandler *handler) const
virtual bool BumpLockTimeout(const StringPiece &lock_name, MessageHandler *handler)
virtual BoolOrError TryLockWithTimeout(const StringPiece &lock_name, int64 timeout_ms, const Timer *timer, MessageHandler *handler)
Definition: file_system.h:76
virtual BoolOrError IsDir(const char *path, MessageHandler *handler)
Like POSIX 'test -d', checks if path exists and refers to a directory.
virtual bool Mtime(const StringPiece &path, int64 *timestamp_sec, MessageHandler *handler)
Modified time. Time the file contents were modified.
Definition: statistics.h:73
Definition: message_handler.h:39
virtual BoolOrError Exists(const char *path, MessageHandler *handler)
Like POSIX 'test -e', checks if path exists (is a file, directory, etc.).
virtual OutputFile * OpenOutputFileHelper(const char *filename, bool append, MessageHandler *message_handler)
Timer interface, made virtual so it can be mocked for tests.
Definition: timer.h:27
virtual bool ListContents(const StringPiece &dir, StringVector *files, MessageHandler *handler)
Definition: file_system.h:113