MCPcopy Create free account
hub / github.com/audacity/audacity / isFolderSymbolicLink

Function isFolderSymbolicLink

libraries/lib-vst3/module_win32.cpp:218–237  ·  view source on GitHub ↗

------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

216
217//------------------------------------------------------------------------
218bool isFolderSymbolicLink (const filesystem::path& p)
219{
220#if USE_FILESYSTEM
221 if (/*filesystem::exists (p) &&*/ filesystem::is_symlink (p))
222 return true;
223#else
224 std::wstring wString = p.generic_wstring ();
225 auto attrib = GetFileAttributesW (reinterpret_cast<LPCWSTR> (wString.c_str ()));
226 if (attrib & FILE_ATTRIBUTE_REPARSE_POINT)
227 {
228 auto hFile = CreateFileW (reinterpret_cast<LPCWSTR> (wString.c_str ()), GENERIC_READ,
229 FILE_SHARE_READ, nullptr, OPEN_EXISTING, 0, nullptr);
230 if (hFile == INVALID_HANDLE_VALUE)
231 return true;
232 else
233 CloseHandle (hFile);
234 }
235#endif
236 return false;
237}
238
239//------------------------------------------------------------------------
240Optional<std::string> getKnownFolder (REFKNOWNFOLDERID folderID)

Callers 1

findFilesWithExtFunction · 0.85

Calls 1

c_strMethod · 0.45

Tested by

no test coverage detected