lyx_mirror/src/support/rename.C
Jean-Marc Lasgouttes cdcb9b2cc0 os:: patch from Ruurd + bindings display fix
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2005 a592a061-630c-0410-9148-cb99ea01b6c8
2001-05-17 15:11:01 +00:00

20 lines
332 B
C

#include <config.h>
#include <cstdio>
#include "support/lyxlib.h"
bool lyx::rename(string const & from, string const & to)
{
#ifdef __EMX__
lyx::unlink(to.c_str());
#endif
if (::rename(from.c_str(), to.c_str()) == -1)
if (lyx::copy(from, to)) {
lyx::unlink(from);
return true;
} else
return false;
return true;
}