MCPcopy Create free account
hub / github.com/MusicPlayerDaemon/MPD / RenameFile

Function RenameFile

src/fs/FileSystem.cxx:20–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18#include <fcntl.h>
19
20void
21RenameFile(Path oldpath, Path newpath)
22{
23#ifdef _WIN32
24 if (!MoveFileEx(oldpath.c_str(), newpath.c_str(),
25 MOVEFILE_REPLACE_EXISTING))
26 throw MakeLastError("Failed to rename file");
27#else
28 if (rename(oldpath.c_str(), newpath.c_str()) < 0)
29 throw MakeErrno("Failed to rename file");
30#endif
31}
32
33AllocatedPath
34ReadLink(Path path) noexcept

Callers 1

spl_rename_internalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected