- return Mover::do_copy(from, to);
-
- string command = support::LibScriptSearch(command_);
- command = support::subst(command, "$$i", from);
- command = support::subst(command, "$$o", to);
+ return Mover::do_copy(from, to, latex, mode);
+
+ if (mode != (unsigned long int)-1) {
+ std::ofstream ofs(to.toFilesystemEncoding().c_str(), ios::binary | ios::out | ios::trunc);
+ if (!ofs)
+ return false;
+ ofs.close();
+ if (!support::chmod(to, mode))
+ return false;
+ }
+
+ string command = support::libScriptSearch(command_);
+ command = support::subst(command, "$$i", from.toFilesystemEncoding());
+ command = support::subst(command, "$$o", to.toFilesystemEncoding());
+ command = support::subst(command, "$$l", latex);