From 6292320bb24ae4a67bca5fe60b6601316d4a59f7 Mon Sep 17 00:00:00 2001 From: Francesco Mecca Date: Thu, 21 Mar 2019 17:39:44 +0100 Subject: [PATCH] support isFile --- source/vibe/core/file.d | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/vibe/core/file.d b/source/vibe/core/file.d index c3b6021..3bd9baf 100644 --- a/source/vibe/core/file.d +++ b/source/vibe/core/file.d @@ -385,6 +385,9 @@ struct FileInfo { /// True if this is a directory or a symlink pointing to a directory bool isDirectory; + /// True if this is a file. On POSIX if both isFile and isDirectory are false it is a special file. + bool isFile; + /** True if the file's hidden attribute is set. On systems that don't support a hidden attribute, any file starting with @@ -737,6 +740,7 @@ private FileInfo makeFileInfo(DirEntry ent) else ret.timeCreated = ent.timeLastModified; ret.isSymlink = ent.isSymlink; ret.isDirectory = ent.isDir; + ret.isFile = ent.isFile; version (Windows) { import core.sys.windows.windows : FILE_ATTRIBUTE_HIDDEN; ret.hidden = (ent.attributes & FILE_ATTRIBUTE_HIDDEN) != 0;