1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-03 22:51:47 +02:00
nix/src/libutil/windows/file-system.cc
2025-05-28 00:48:10 +02:00

32 lines
879 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);
}
}
#endif