aboutsummaryrefslogtreecommitdiffstats
path: root/src/PlaylistFile.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-02-28 20:42:50 +0100
committerMax Kellermann <max@duempel.org>2015-02-28 23:00:26 +0100
commit90a61b6babe3528efd982511790057e1e1e39b81 (patch)
treecae3a8072a056118865a988042e1f1269d11e277 /src/PlaylistFile.cxx
parent00583bc4a8357cf43930151650dc058225675403 (diff)
downloadmpd-90a61b6babe3528efd982511790057e1e1e39b81.tar.gz
mpd-90a61b6babe3528efd982511790057e1e1e39b81.tar.xz
mpd-90a61b6babe3528efd982511790057e1e1e39b81.zip
fs/FileInfo: new library providing GetFileInfo()
Replaces StatFile(), with a portable data object.
Diffstat (limited to 'src/PlaylistFile.cxx')
-rw-r--r--src/PlaylistFile.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/PlaylistFile.cxx b/src/PlaylistFile.cxx
index f77d1930f..4c2f8d22e 100644
--- a/src/PlaylistFile.cxx
+++ b/src/PlaylistFile.cxx
@@ -35,6 +35,7 @@
#include "fs/Traits.hxx"
#include "fs/Charset.hxx"
#include "fs/FileSystem.hxx"
+#include "fs/FileInfo.hxx"
#include "fs/DirectoryReader.hxx"
#include "util/StringUtil.hxx"
#include "util/UriUtil.hxx"
@@ -178,8 +179,8 @@ LoadPlaylistFileInfo(PlaylistInfo &info,
return false;
const auto path_fs = AllocatedPath::Build(parent_path_fs, name_fs);
- struct stat st;
- if (!StatFile(path_fs, st) || !S_ISREG(st.st_mode))
+ FileInfo fi;
+ if (!GetFileInfo(path_fs, fi) || !fi.IsRegular())
return false;
std::string name(name_fs_str,
@@ -189,7 +190,7 @@ LoadPlaylistFileInfo(PlaylistInfo &info,
return false;
info.name = std::move(name_utf8);
- info.mtime = st.st_mtime;
+ info.mtime = fi.GetModificationTime();
return true;
}