mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
Core: FindFile::IsExecutable
git-svn-id: svn://ultimatepp.org/upp/trunk@2200 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
dc00b266e2
commit
449208fcc9
2 changed files with 12 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue