+ // Remove old file. Not doing this would cause Bad Stuff when installing libraries.
+ if(FS::exists(copy.dest))
+ {
+ try
+ {
+ unlink(copy.dest);
+ }
+ catch(const Exception &e)
+ {
+ IO::print(IO::cerr, "%s\n", e.what());
+ done = error = true;
+ return;
+ }
+ }
+
+ try
+ {
+ IO::File in(copy.src.str());
+ IO::File out(copy.dest.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)