X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=nucleus%2Flibrary%2Ffilesystem%2Fdirectory_tree.cpp;fp=nucleus%2Flibrary%2Ffilesystem%2Fdirectory_tree.cpp;h=dc78832fb64d13d977724ede7afabed1543c53ac;hb=e077c4de15dac0c54a37cef7ccb376e582c09ac8;hp=2be520f3f5069f0b7a99ec6c4f619cf79309884e;hpb=5858fce4a490cf6d026460e30b3b4cb602150a86;p=feisty_meow.git diff --git a/nucleus/library/filesystem/directory_tree.cpp b/nucleus/library/filesystem/directory_tree.cpp index 2be520f3..dc78832f 100644 --- a/nucleus/library/filesystem/directory_tree.cpp +++ b/nucleus/library/filesystem/directory_tree.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -28,16 +29,17 @@ #include using namespace basis; -using namespace structures; +using namespace loggers; using namespace nodes; +using namespace structures; using namespace textual; -#define DEBUG_DIRECTORY_TREE +//#define DEBUG_DIRECTORY_TREE // uncomment for noisier version. #undef LOG -#define LOG(to_print) printf("%s::%s: %s\n", static_class_name(), func, astring(to_print).s()) -//CLASS_EMERGENCY_LOG(program_wide_logger::get(), s) +#define LOG(to_print) CLASS_EMERGENCY_LOG(program_wide_logger::get(), to_print) +//printf("%s::%s: %s\n", static_class_name(), func, astring(to_print).s()) ////////////// @@ -434,6 +436,12 @@ filename_tree *directory_tree::seek(const astring &dir_name_in, for (posn = 0; posn < examining.length(); posn++) { check = examining[posn]; filename current(check->_dirname); + if (!current.is_normal()) { +//#ifdef DEBUG_DIRECTORY_TREE + LOG(astring("skipping abnormal dir: ") + current); +//#endif + continue; + } #ifdef DEBUG_DIRECTORY_TREE LOG(astring("looking at ") + current.raw()); #endif @@ -805,8 +813,8 @@ outcome directory_tree::add_path(const astring &new_item, bool just_size) int file_subtract = 0; // if it's a file, then we remove last component. if (!adding.is_directory()) file_subtract = 1; #ifdef DEBUG_DIRECTORY_TREE - if (file_subtract) LOG(astring("adding a file ") + new_item); - else LOG(astring("adding a directory ") + new_item); + if (file_subtract) { LOG(astring("adding a file ") + new_item); } + else { LOG(astring("adding a directory ") + new_item); } #endif // find the common root, break up the path into pieces, and tell us where