Skip to content

Instantly share code, notes, and snippets.

View DrPizza's full-sized avatar
🙄
they see me rollin'. they hatin'.

Peter Bright DrPizza

🙄
they see me rollin'. they hatin'.
View GitHub Profile
@DrPizza
DrPizza / equivalent.cpp
Last active February 21, 2017 05:49 — forked from BillyONeal/equivalent.cpp
std::filesystem::equivalent
#include <vcruntime.h>
__std_win32_error __std_fs_equivalent(bool * _Result, const wchar_t *_Path1, const wchar_t *_Path2) noexcept
{ // test for equivalent file names
const __vcp_unique_handle _Handle1(_FilesysOpenFile(_Path1, FILE_READ_ATTRIBUTES, FILE_FLAG_BACKUP_SEMANTICS));
if (!_Handle1.is_valid())
{
*_Result = false;
return (GetLastError());
}