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