MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / renameFile

Method renameFile

other_src/astyle/src/astyle_main.cpp:1805–1820  ·  view source on GitHub ↗

rename a file and check for an error

Source from the content-addressed store, hash-verified

1803
1804// rename a file and check for an error
1805void ASConsole::renameFile(const char* oldFileName, const char* newFileName, const char* errMsg) const
1806{
1807 rename(oldFileName, newFileName);
1808 // if file still exists the remove needs more time - retry
1809 if (errno == EEXIST)
1810 {
1811 errno = 0;
1812 waitForRemove(newFileName);
1813 rename(oldFileName, newFileName);
1814 }
1815 if (errno)
1816 {
1817 perror("errno message");
1818 error(errMsg, oldFileName);
1819 }
1820}
1821
1822// make sure file separators are correct type (Windows or Linux)
1823// remove ending file separator

Callers

nothing calls this directly

Calls 1

errorFunction · 0.50

Tested by

no test coverage detected