]> git.lyx.org Git - lyx.git/blob - src/support/rename.C
split LyXText::rowlist_ into individual Paragraph::rows_ chunks
[lyx.git] / src / support / rename.C
1 /**
2  * \file rename.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Lars Gullik Bjønnes
7  *
8  * Full author contact details are available in file CREDITS
9  */
10
11 #include <config.h>
12
13 #include <cstdio>
14
15 #include "support/lyxlib.h"
16
17 bool lyx::support::rename(string const & from, string const & to)
18 {
19 #ifdef __EMX__
20         unlink(to);
21 #endif
22         if (::rename(from.c_str(), to.c_str()) == -1)
23                 if (copy(from, to)) {
24                         unlink(from);
25                         return true;
26                 } else
27                         return false;
28         return true;
29 }