diff options
Diffstat (limited to 'base/file_util_posix.cc')
-rw-r--r-- | base/file_util_posix.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc index ae296ca..96c1c17 100644 --- a/base/file_util_posix.cc +++ b/base/file_util_posix.cc @@ -440,6 +440,16 @@ bool GetFileInfo(const FilePath& file_path, FileInfo* results) { return true; } +bool GetInode(const FilePath& path, ino_t* inode) { + struct stat buffer; + int result = stat(path.value().c_str(), &buffer); + if (result < 0) + return false; + + *inode = buffer.st_ino; + return true; +} + FILE* OpenFile(const std::string& filename, const char* mode) { return OpenFile(FilePath(filename), mode); } |