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())
//////////////
// open the file for updating (either read or write).
if (!target_file.good()) return TARGET_ACCESS_ERROR;
double curr_len = target_file.length();
+ target_file.touch();
if (curr_len < byte_start) {
byte_array new_chunk;
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;