| 305 | } |
| 306 | |
| 307 | Status PosixFileSystem::Stat(const string& fname, FileStatistics* stats) { |
| 308 | Status s; |
| 309 | struct stat sbuf; |
| 310 | if (stat(TranslateName(fname).c_str(), &sbuf) != 0) { |
| 311 | s = IOError(fname, errno); |
| 312 | } else { |
| 313 | stats->length = sbuf.st_size; |
| 314 | stats->mtime_nsec = sbuf.st_mtime * 1e9; |
| 315 | stats->is_directory = S_ISDIR(sbuf.st_mode); |
| 316 | } |
| 317 | return s; |
| 318 | } |
| 319 | |
| 320 | Status PosixFileSystem::RenameFile(const string& src, const string& target) { |
| 321 | Status result; |