2000-09-05 13:16:19 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
2000-09-26 13:54:57 +00:00
|
|
|
#include <cstdio>
|
2000-09-05 13:16:19 +00:00
|
|
|
|
|
|
|
#include "support/lyxlib.h"
|
|
|
|
|
2000-09-26 13:54:57 +00:00
|
|
|
bool lyx::rename(string const & from, string const & to)
|
|
|
|
{
|
2001-05-17 15:11:01 +00:00
|
|
|
#ifdef __EMX__
|
|
|
|
lyx::unlink(to.c_str());
|
|
|
|
#endif
|
2000-11-06 11:20:22 +00:00
|
|
|
if (::rename(from.c_str(), to.c_str()) == -1)
|
2000-11-13 10:35:02 +00:00
|
|
|
if (lyx::copy(from, to)) {
|
|
|
|
lyx::unlink(from);
|
|
|
|
return true;
|
|
|
|
} else
|
|
|
|
return false;
|
2000-11-06 11:20:22 +00:00
|
|
|
return true;
|
2000-09-26 13:54:57 +00:00
|
|
|
}
|