diff options
Diffstat (limited to 'winsup/cygwin/path.h')
-rw-r--r-- | winsup/cygwin/path.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h index 14c23ebe5..de37ff2ac 100644 --- a/winsup/cygwin/path.h +++ b/winsup/cygwin/path.h @@ -14,6 +14,13 @@ details. */ #include <fcntl.h> #include <ntdef.h> +inline bool +has_attribute (DWORD attributes, DWORD attribs_to_test) +{ + return attributes != INVALID_FILE_ATTRIBUTES + && (attributes & attribs_to_test); +} + enum executable_states { is_executable, @@ -161,6 +168,7 @@ class path_conv bool isro () const {return !!(path_flags & PATH_RO);} bool exists () const {return fileattr != INVALID_FILE_ATTRIBUTES;} bool has_attribute (DWORD x) const {return exists () && (fileattr & x);} + void set_attributes (DWORD x) {fileattr = x;} int isdir () const {return has_attribute (FILE_ATTRIBUTE_DIRECTORY);} executable_states exec_state () { |