Merge tag 'v0.23.11'

release v0.23.11
This commit is contained in:
Max Kellermann
2022-11-28 17:00:38 +01:00
10 changed files with 85 additions and 11 deletions

View File

@@ -67,6 +67,16 @@ StatFile(Path file, struct stat &buf, bool follow_symlinks = true)
#endif
static inline bool
CreateDirectoryNoThrow(Path path) noexcept
{
#ifdef _WIN32
return CreateDirectory(path.c_str(), nullptr);
#else
return mkdir(path.c_str(), 0777);
#endif
}
/**
* Truncate a file that exists already. Throws std::system_error on
* error.