mirror of
https://github.com/NixOS/nix.git
synced 2025-12-07 01:21:00 +01:00
* It is tough to contribute to a project that doesn't use a formatter, * It is extra hard to contribute to a project which has configured the formatter, but ignores it for some files * Code formatting makes it harder to hide obscure / weird bugs by accident or on purpose, Let's rip the bandaid off? Note that PRs currently in flight should be able to be merged relatively easily by applying `clang-format` to their tip prior to merge.
32 lines
896 B
C++
32 lines
896 B
C++
#include "nix/util/file-system.hh"
|
|
#include "nix/util/logging.hh"
|
|
|
|
#ifdef _WIN32
|
|
namespace nix {
|
|
|
|
void setWriteTime(
|
|
const std::filesystem::path & path, time_t accessedTime, time_t modificationTime, std::optional<bool> optIsSymlink)
|
|
{
|
|
// FIXME use `std::filesystem::last_write_time`.
|
|
//
|
|
// Would be nice to use std::filesystem unconditionally, but
|
|
// doesn't support access time just modification time.
|
|
//
|
|
// System clock vs File clock issues also make that annoying.
|
|
warn("Changing file times is not yet implemented on Windows, path is %s", path);
|
|
}
|
|
|
|
Descriptor openDirectory(const std::filesystem::path & path)
|
|
{
|
|
return CreateFileW(
|
|
path.c_str(),
|
|
GENERIC_READ,
|
|
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
|
|
NULL,
|
|
OPEN_EXISTING,
|
|
FILE_FLAG_BACKUP_SEMANTICS,
|
|
NULL);
|
|
}
|
|
|
|
} // namespace nix
|
|
#endif
|