]> git.lyx.org Git - lyx.git/blobdiff - src/support/rename.C
remove unused stuff
[lyx.git] / src / support / rename.C
index b92b7a9cfaf8794e39fba49e6132bcf5fc959a6a..33045adbaae3c94bdfe033d75a6625d459d91719 100644 (file)
 
 #include <config.h>
 
+#include "support/lyxlib.h"
+#include "support/filename.h"
+
 #include <cstdio>
 
-#include "support/lyxlib.h"
 
-bool lyx::support::rename(string const & from, string const & to)
+namespace lyx {
+namespace support {
+
+
+using std::string;
+
+
+bool rename(FileName const & from, FileName const & to)
 {
-#ifdef __EMX__
-       unlink(to);
-#endif
-       if (::rename(from.c_str(), to.c_str()) == -1)
+       if (::rename(from.toFilesystemEncoding().c_str(), to.toFilesystemEncoding().c_str()) == -1)
                if (copy(from, to)) {
                        unlink(from);
                        return true;
@@ -27,3 +33,7 @@ bool lyx::support::rename(string const & from, string const & to)
                        return false;
        return true;
 }
+
+
+} // namespace support
+} // namespace lyx