| 171 | } // FileIo::Impl::switchMode |
| 172 | |
| 173 | int FileIo::Impl::stat(StructStat& buf) const { |
| 174 | struct stat st; |
| 175 | auto ret = ::stat(path_.c_str(), &st); |
| 176 | if (ret == 0) { |
| 177 | buf.st_size = st.st_size; |
| 178 | buf.st_mode = st.st_mode; |
| 179 | } |
| 180 | return ret; |
| 181 | } // FileIo::Impl::stat |
| 182 | |
| 183 | FileIo::FileIo(const std::string& path) : p_(std::make_unique<Impl>(path)) { |
| 184 | } |