mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-09 23:26:47 +02:00
Remove utils::file::exists
This commit is contained in:
parent
da687c1585
commit
01e35e9004
5 changed files with 27 additions and 34 deletions
|
@ -28,6 +28,8 @@
|
|||
|
||||
// standard headers
|
||||
#include <climits>
|
||||
#include <cstdio>
|
||||
#include <filesystem>
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
@ -48,17 +50,10 @@ ProcessStream::ProcessStream(PcmStream::Listener* pcmListener, boost::asio::io_c
|
|||
}
|
||||
|
||||
|
||||
bool ProcessStream::fileExists(const std::string& filename) const
|
||||
{
|
||||
struct stat buffer;
|
||||
return (stat(filename.c_str(), &buffer) == 0);
|
||||
}
|
||||
|
||||
|
||||
std::string ProcessStream::findExe(const std::string& filename) const
|
||||
{
|
||||
/// check if filename exists
|
||||
if (fileExists(filename))
|
||||
if (std::filesystem::exists(filename))
|
||||
return filename;
|
||||
|
||||
std::string exe = filename;
|
||||
|
@ -95,7 +90,7 @@ void ProcessStream::initExeAndPath(const std::string& filename)
|
|||
exe_ = exe_.substr(exe_.find_last_of('/') + 1);
|
||||
}
|
||||
|
||||
if (!fileExists(path_ + exe_))
|
||||
if (!std::filesystem::exists(path_ + exe_))
|
||||
throw SnapException("file not found: \"" + filename + "\"");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue