fs/FileSystem: RemoveFile() throws exception on error

This commit is contained in:
Max Kellermann
2016-08-15 22:25:15 +02:00
parent 14d3da0e18
commit ea0e6d9824
8 changed files with 48 additions and 22 deletions

View File

@@ -100,17 +100,11 @@ void
TruncateFile(Path path);
/**
* Wrapper for unlink() that uses #Path names.
* Wrapper for unlink() that uses #Path names. Throws
* std::system_error on error.
*/
static inline bool
RemoveFile(Path file)
{
#ifdef WIN32
return _tunlink(file.c_str()) == 0;
#else
return unlink(file.c_str()) == 0;
#endif
}
void
RemoveFile(Path path);
/**
* Wrapper for readlink() that uses #Path names.