namespace filesystem {
-//#define DEBUG_HEAVY_FILE_OPS
+#define DEBUG_HEAVY_FILE_OPS
// uncomment for noisier debugging.
#undef LOG
const filename_list &to_transfer, file_transfer_header &last_action,
byte_array &storage, int maximum_bytes)
{
-#ifdef DEBUG_HEAVY_FILE_OPS
-// FUNCDEF("buffer_files");
-#endif
+ FUNCDEF("buffer_files");
storage.reset(); // clear out the current contents.
if (!to_transfer.elements()) {
// we seem to be done.
- return OKAY;
+ return FINISHED;
}
outcome to_return = OKAY;
huge_file current(full_file, "rb");
if (!current.good()) {
// we need to skip this file.
+LOG(astring("skipping bad file: ") + full_file);
if (!advance(to_transfer, last_action)) break;
continue;
}
- if ((last_action._byte_start + last_action._length >= current.length())
- && current.length()) {
+ if (last_action._byte_start + last_action._length >= current.length()) {
+LOG(astring("finished handling file: ") + full_file);
// this file is done now. go to the next one.
if (!advance(to_transfer, last_action)) break;
continue;