Skip to content

Commit

Permalink
RemoteFile::Exists(): Update the stat struct for local files
Browse files Browse the repository at this point in the history
This just makes the behaviour consistent for both local and remote files.
  • Loading branch information
Paul Harrison committed Sep 6, 2013
1 parent b0d496e commit b1987c4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions mythtv/libs/libmythbase/remotefile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,25 @@ bool RemoteFile::Exists(const QString &url, struct stat *fileinfo)
{
if (isLocal(url))
{
LOG(VB_FILE, LOG_INFO,
QString("RemoteFile::Exists(): looking for local file: %1").arg(url));

QFileInfo info(url);
if (info.exists())
{
if (stat(url.toLocal8Bit().constData(), fileinfo) == -1)
{
LOG(VB_FILE, LOG_ERR,
QString("RemoteFile::Exists(): failed to stat file: %1").arg(url) + ENO);
}
}

return info.exists() && info.isFile();
}

LOG(VB_FILE, LOG_INFO,
QString("RemoteFile::Exists(): looking for remote file: %1").arg(url));

QUrl qurl(url);
QString filename = qurl.path();
QString sgroup = qurl.userName();
Expand Down

0 comments on commit b1987c4

Please sign in to comment.