refactor
This commit is contained in:
parent
924b79add2
commit
8e2ebf05b8
@ -137,14 +137,15 @@ public:
|
||||
|
||||
auto populate_file_info(const std::string &api_path,
|
||||
remote::file_info &file_info) -> api_error override {
|
||||
const auto file_path = utils::path::combine(mount_location_, {api_path});
|
||||
const auto directory = utils::file::directory(file_path).exists();
|
||||
const auto attributes =
|
||||
auto file_path = utils::path::combine(mount_location_, {api_path});
|
||||
auto directory = utils::file::directory(file_path).exists();
|
||||
auto attributes =
|
||||
FILE_FLAG_BACKUP_SEMANTICS |
|
||||
(directory ? FILE_ATTRIBUTE_DIRECTORY : FILE_ATTRIBUTE_NORMAL);
|
||||
const auto share_mode = FILE_SHARE_READ | FILE_SHARE_WRITE;
|
||||
auto handle = ::CreateFileA(&file_path[0], GENERIC_READ, share_mode,
|
||||
nullptr, OPEN_EXISTING, attributes, nullptr);
|
||||
auto share_mode = FILE_SHARE_READ | FILE_SHARE_WRITE;
|
||||
auto handle =
|
||||
::CreateFileA(file_path.c_str(), GENERIC_READ, share_mode, nullptr,
|
||||
OPEN_EXISTING, static_cast<DWORD>(attributes), nullptr);
|
||||
FILE_BASIC_INFO fi{};
|
||||
::GetFileInformationByHandleEx(handle, FileBasicInfo, &fi, sizeof(fi));
|
||||
if (not directory) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user