- Path::stat(copy.src, st);
- chmod(copy.dest.str().c_str(), st.st_mode&0777);
+ if(stat(copy.src.str().c_str(), &st)==0)
+ chmod(copy.dest.str().c_str(), st.st_mode&0777);
+
+ if(!copy.link.empty())
+ {
+ FS::Path relpath = FS::relative(copy.dest, FS::dirname(copy.link));
+ symlink(relpath.str().c_str(), copy.link.str().c_str());
+ }