Changeset 1186 for trunk/lib/utility.cc
- Timestamp:
- Aug 28, 2010, 12:13:37 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/utility.cc
r1132 r1186 170 170 171 171 172 void lstat(const std::string path, struct stat* nodestat) 173 { 174 int res = ::lstat(path.c_str(), nodestat); 175 if (res) { 176 throw yat::utility::errno_error("lstat: "); 177 } 178 } 179 180 172 181 std::string ltrim(std::string str) 173 182 { … … 183 192 if (code){ 184 193 std::stringstream ss; 185 ss << "mkdir (" << dir << "): failed\n" << strerror(errno);186 throw std::runtime_error(ss.str());194 ss << "mkdir: `" << dir << "': "; 195 throw yat::utility::errno_error(ss.str()); 187 196 } 188 197 } … … 294 303 if (code){ 295 304 std::stringstream ss; 296 ss << "rename (" << from << ", " << to << "): failed\n" << strerror(errno);297 throw std::runtime_error(ss.str());305 ss << "rename" << from << " to " << to << ": "; 306 throw yat::utility::errno_error(ss.str()); 298 307 } 299 308 }
Note: See TracChangeset
for help on using the changeset viewer.