upped time between retries.
[feisty_meow.git] / nucleus / library / filesystem / heavy_file_ops.cpp
index 0900b4328b9b52d5f4129b0d0158597d59421430..9a5451b74687355869bcf82de5e0803efc703423 100644 (file)
@@ -27,16 +27,12 @@ using namespace structures;
 
 namespace filesystem {
 
-#define DEBUG_HEAVY_FILE_OPS
+//#define DEBUG_HEAVY_FILE_OPS
   // uncomment for noisier debugging.
 
 #undef LOG
-#ifdef DEBUG_HEAVY_FILE_OPS
-  #include <stdio.h>
-  #define LOG(to_print) printf("%s::%s: %s\n", static_class_name(), func, astring(to_print).s())
-#else
-  #define LOG(s) {if(!!s){}}
-#endif
+#include <stdio.h>
+#define LOG(to_print) printf("%s::%s: %s\n", static_class_name(), func, astring(to_print).s())
 
 //////////////
 
@@ -176,7 +172,11 @@ outcome heavy_file_operations::write_file_chunk(const astring &target,
   if (byte_start < 0) return BAD_INPUT;
 
   filename targ_name(target);
-  if (!directory::recursive_create(targ_name.dirname().raw())) {
+  astring targ_dir = targ_name.dirname().raw();
+#ifdef DEBUG_HEAVY_FILE_OPS
+  LOG(astring("creating target's directory: ") + targ_name.dirname().raw());
+#endif
+  if (!directory::recursive_create(targ_dir)) {
     LOG(astring("failed to create directory: ") + targ_name.dirname().raw());
     return TARGET_DIR_ERROR;
   }
@@ -286,7 +286,9 @@ outcome heavy_file_operations::buffer_files(const astring &source_root,
 
     if (last_action._byte_start + last_action._length >= current.length()) {
       // this file is done now.  go to the next one.
+#ifdef DEBUG_HEAVY_FILE_OPS
       LOG(astring("finished stuffing file: ") + full_file);
+#endif
       to_return = advance(to_transfer, last_action);
       if (to_return != OKAY) break;
       continue;