diff --git a/uppsrc/Core/Path.cpp b/uppsrc/Core/Path.cpp index 638bb27a5..99bab8b31 100644 --- a/uppsrc/Core/Path.cpp +++ b/uppsrc/Core/Path.cpp @@ -449,6 +449,11 @@ bool FindFile::IsSymLink() const return sGetSymLinkPath0(AppendFileName(path, name), NULL); } +bool FindFile::IsExecutable() const +{ + return !IsDirectory() && ToLower(GetName()).EndsWith(".exe"); } +} + void FindFile::Close() { if(handle != INVALID_HANDLE_VALUE) FindClose(handle); handle = INVALID_HANDLE_VALUE; @@ -654,6 +659,11 @@ bool FindFile::IsSymLink() const return false; } +bool FindFile::IsExecutable() const +{ + return !IsDirectory() && ((S_IXUSR|S_IXGRP|S_IXOTH) & GetMode()); +} + bool FindFile::Next() { if(!dir) return false; statis = false; diff --git a/uppsrc/Core/Path.h b/uppsrc/Core/Path.h index 7e06e62d7..fe9308ae4 100644 --- a/uppsrc/Core/Path.h +++ b/uppsrc/Core/Path.h @@ -76,6 +76,7 @@ public: bool IsFolder() const; bool IsFile() const { return !IsDirectory(); } bool IsSymLink() const; + bool IsExecutable() const; bool IsArchive() const; bool IsCompressed() const; @@ -137,6 +138,7 @@ public: bool IsFolder() const; bool IsFile() const { return S_ISREG(GetMode()); } bool IsSymLink() const; + bool IsExecutable() const; operator bool() const { return file; }