MCPcopy Create free account
hub / github.com/catboost/catboost / RemoveDirWithContents

Function RemoveDirWithContents

util/folder/dirut.cpp:412–430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410}
411
412void 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
432int mkpath(char* path, int mode) {
433 return NFs::MakeDirectoryRecursive(path, NFs::EFilePermission(mode)) ? 0 : -1;

Callers 2

~TTempDirMethod · 0.85
Y_UNIT_TESTFunction · 0.85

Calls 4

SlashFolderLocalFunction · 0.85
TOptionsClass · 0.70
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected