2 #include <msp/path/utils.h>
9 Copy::Copy(Builder &b, const Package &pkg, const Path::Path &s, const Path::Path &d):
15 announce(pkg.get_name(), "INST", dest[-1]);
29 void Copy::Worker::main()
31 Path::mkpath(copy.src.subpath(0, copy.src.size()-1), 0755);
32 unlink(copy.dest.str().c_str());
33 ifstream in(copy.src.str().c_str());
34 ofstream out(copy.dest.str().c_str());
39 in.read(buf, sizeof(buf));
40 out.write(buf, in.gcount());
44 Path::stat(copy.src, st);
45 chmod(copy.dest.str().c_str(), st.st_mode&0777);