- in.read(buf, sizeof(buf));
- out.write(buf, in.gcount());
+ IO::File in(src_path.str());
+ IO::File out(dst_path.str(), IO::M_WRITE);
+
+ // Actual transfer loop
+ char buf[16384];
+ while(!in.eof())
+ {
+ unsigned len = in.read(buf, sizeof(buf));
+ out.write(buf, len);
+ }
+ }
+ catch(const exception &e)
+ {
+ IO::print(IO::cerr, "%s\n", e.what());
+ status = Task::ERROR;
+ return;