From 90a61b6babe3528efd982511790057e1e1e39b81 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 28 Feb 2015 20:42:50 +0100 Subject: fs/FileInfo: new library providing GetFileInfo() Replaces StatFile(), with a portable data object. --- src/PlaylistFile.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/PlaylistFile.cxx') 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; } -- cgit v1.2.3