diff --git a/webrtc/rtc_base/fileutils.h b/webrtc/rtc_base/fileutils.h index a4a94727aa..ba4b28995e 100644 --- a/webrtc/rtc_base/fileutils.h +++ b/webrtc/rtc_base/fileutils.h @@ -98,10 +98,6 @@ class FilesystemInterface { // Returns true if pathname refers to a file virtual bool IsFile(const Pathname& pathname) = 0; - // Returns true if pathname refers to no filesystem object, every parent - // directory either exists, or is also absent. - virtual bool IsAbsent(const Pathname& pathname) = 0; - virtual std::string TempFilename(const Pathname &dir, const std::string &prefix) = 0; @@ -147,10 +143,6 @@ class Filesystem { return EnsureDefaultFilesystem()->IsFile(pathname); } - static bool IsAbsent(const Pathname &pathname) { - return EnsureDefaultFilesystem()->IsAbsent(pathname); - } - static std::string TempFilename(const Pathname &dir, const std::string &prefix) { return EnsureDefaultFilesystem()->TempFilename(dir, prefix); diff --git a/webrtc/rtc_base/unixfilesystem.cc b/webrtc/rtc_base/unixfilesystem.cc index ebf20c7c99..3a63e23189 100644 --- a/webrtc/rtc_base/unixfilesystem.cc +++ b/webrtc/rtc_base/unixfilesystem.cc @@ -144,14 +144,6 @@ bool UnixFilesystem::IsFile(const Pathname& pathname) { return res == 0 && !S_ISDIR(st.st_mode); } -bool UnixFilesystem::IsAbsent(const Pathname& pathname) { - struct stat st; - int res = ::stat(pathname.pathname().c_str(), &st); - // Note: we specifically maintain ENOTDIR as an error, because that implies - // that you could not call CreateFolder(pathname). - return res != 0 && ENOENT == errno; -} - bool UnixFilesystem::GetFileSize(const Pathname& pathname, size_t *size) { struct stat st; if (::stat(pathname.pathname().c_str(), &st) != 0) diff --git a/webrtc/rtc_base/unixfilesystem.h b/webrtc/rtc_base/unixfilesystem.h index 7270b83778..3c157cb171 100644 --- a/webrtc/rtc_base/unixfilesystem.h +++ b/webrtc/rtc_base/unixfilesystem.h @@ -46,10 +46,6 @@ class UnixFilesystem : public FilesystemInterface { // Returns true of pathname represents an existing file bool IsFile(const Pathname& pathname) override; - // Returns true if pathname refers to no filesystem object, every parent - // directory either exists, or is also absent. - bool IsAbsent(const Pathname& pathname) override; - std::string TempFilename(const Pathname& dir, const std::string& prefix) override; diff --git a/webrtc/rtc_base/win32filesystem.cc b/webrtc/rtc_base/win32filesystem.cc index 45441855e9..92ad70b1cf 100644 --- a/webrtc/rtc_base/win32filesystem.cc +++ b/webrtc/rtc_base/win32filesystem.cc @@ -111,15 +111,6 @@ bool Win32Filesystem::IsFile(const Pathname &path) { return (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0; } -bool Win32Filesystem::IsAbsent(const Pathname& path) { - WIN32_FILE_ATTRIBUTE_DATA data = {0}; - if (0 != ::GetFileAttributesEx(ToUtf16(path.pathname()).c_str(), - GetFileExInfoStandard, &data)) - return false; - DWORD err = ::GetLastError(); - return (ERROR_FILE_NOT_FOUND == err || ERROR_PATH_NOT_FOUND == err); -} - bool Win32Filesystem::GetFileSize(const Pathname &pathname, size_t *size) { WIN32_FILE_ATTRIBUTE_DATA data = {0}; if (::GetFileAttributesEx(ToUtf16(pathname.pathname()).c_str(), diff --git a/webrtc/rtc_base/win32filesystem.h b/webrtc/rtc_base/win32filesystem.h index 9d420331e5..0fff15dfe0 100644 --- a/webrtc/rtc_base/win32filesystem.h +++ b/webrtc/rtc_base/win32filesystem.h @@ -38,10 +38,6 @@ class Win32Filesystem : public FilesystemInterface { // Returns true if a file exists at path bool IsFile(const Pathname& path) override; - // Returns true if pathname refers to no filesystem object, every parent - // directory either exists, or is also absent. - bool IsAbsent(const Pathname& pathname) override; - // All of the following functions set pathname and return true if successful. // Returned paths always include a trailing backslash. // If create is true, the path will be recursively created.