Remove metadata pipe on behalf of shairport sync

This commit is contained in:
badaix 2020-12-05 20:26:48 +01:00
parent ad538d5178
commit 296a2f4dea
4 changed files with 28 additions and 8 deletions

View file

@ -37,8 +37,15 @@ namespace file
static bool exists(const std::string& filename)
{
std::ifstream infile(filename.c_str());
return infile.good();
if (filename.empty())
return false;
#ifdef WINDOWS
DWORD dwAttrib = GetFileAttributes(filename.c_str());
return (dwAttrib != INVALID_FILE_ATTRIBUTES);
#else
struct stat buffer;
return (stat(filename.c_str(), &buffer) == 0);
#endif
}
#ifndef WINDOWS