std::filesystem::(weakly_)canonical excepts when using the path to ramdisk
Status: Inactive
Brought to you by:
w77
I created the RAM disk using the tool.
When I try to use the std::filesystem::canonical or std::filesystem::weakly_canonical functions on paths pointing to RAM disk drive I get the exception:
#include <iostream>
#include <filesystem>
int main()
{
std::filesystem::path path("R:/");
try {
std::cout << std::filesystem::weakly_canonical(path).generic_string() << std::endl;
} catch (const std::filesystem::filesystem_error &fserr) {
std::cout << fserr.code().message() << "(" << fserr.code().value() << "):" << fserr.what()
<< std::endl;
}
return 0;
}
The output is following:
Incorrect function.(1):weakly_canonical: Incorrect function.: "R:/"