MCPcopy Create free account
hub / github.com/apache/impala / GetFileModifiedTime

Method GetFileModifiedTime

be/src/kudu/util/env_posix.cc:1881–1896  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1879 }
1880
1881 virtual Status GetFileModifiedTime(const string& fname, int64_t* timestamp) override {
1882 TRACE_EVENT1("io", "PosixEnv::GetFileModifiedTime", "fname", fname);
1883 MAYBE_RETURN_EIO(fname, IOError(Env::kInjectedFailureStatusMsg, EIO));
1884 ThreadRestrictions::AssertIOAllowed();
1885
1886 struct stat s;
1887 if (stat(fname.c_str(), &s) != 0) {
1888 return IOError(fname, errno);
1889 }
1890#ifdef __APPLE__
1891 *timestamp = s.st_mtimespec.tv_sec * 1000000 + s.st_mtimespec.tv_nsec / 1000;
1892#else
1893 *timestamp = s.st_mtim.tv_sec * 1000000 + s.st_mtim.tv_nsec / 1000;
1894#endif
1895 return Status::OK();
1896 }
1897
1898 // Local convenience function for safely running statvfs().
1899 static Status StatVfs(const string& path, struct statvfs* buf) {

Callers 2

TEST_FFunction · 0.80

Calls 3

OKFunction · 0.85
IOErrorFunction · 0.70
statClass · 0.70

Tested by 1

TEST_FFunction · 0.64