| 249 | } |
| 250 | |
| 251 | bool |
| 252 | IsDirectory(std::string const& path) |
| 253 | { |
| 254 | US_STAT s; |
| 255 | errno = 0; |
| 256 | if (us_stat(path.c_str(), &s)) |
| 257 | { |
| 258 | if (not_found_c_error(errno)) |
| 259 | { |
| 260 | return false; |
| 261 | } |
| 262 | else |
| 263 | { |
| 264 | throw std::invalid_argument(GetLastCErrorStr()); |
| 265 | } |
| 266 | } |
| 267 | return S_ISDIR(s.st_mode); |
| 268 | } |
| 269 | |
| 270 | bool |
| 271 | IsFile(std::string const& path) |