| 410 | } |
| 411 | |
| 412 | void RemoveDirWithContents(TString dirName) { |
| 413 | SlashFolderLocal(dirName); |
| 414 | |
| 415 | TDirIterator dir(dirName, TDirIterator::TOptions(FTS_NOSTAT)); |
| 416 | |
| 417 | for (auto it = dir.begin(); it != dir.end(); ++it) { |
| 418 | switch (it->fts_info) { |
| 419 | case FTS_F: |
| 420 | case FTS_DEFAULT: |
| 421 | case FTS_DP: |
| 422 | case FTS_SL: |
| 423 | case FTS_SLNONE: |
| 424 | if (!NFs::Remove(it->fts_path)) { |
| 425 | ythrow TSystemError() << "error while removing " << it->fts_path; |
| 426 | } |
| 427 | break; |
| 428 | } |
| 429 | } |
| 430 | } |
| 431 | |
| 432 | int mkpath(char* path, int mode) { |
| 433 | return NFs::MakeDirectoryRecursive(path, NFs::EFilePermission(mode)) ? 0 : -1; |
no test coverage detected