Esempio n. 1
0
    def is_hidden(self, fn):
        if platform == 'win':
            hidden = False
            hidden2 = basename(fn).startswith('.')

            try:
                hidden = GetFileAttributesExW(fn)[0] & FILE_ATTRIBUTE_HIDDEN
            except:
                pass

            if hidden or hidden2:
                return True
            return False
Esempio n. 2
0
    def is_hidden(self, fn):
        if platform == 'win':
            if not _have_win32file:
                return False
            try:
                return GetFileAttributesExW(fn)[0] & FILE_ATTRIBUTE_HIDDEN
            except error:
                # This error can occured when a file is already accessed by
                # someone else. So don't return to True, because we have lot
                # of chances to not being able to do anything with it.
                Logger.exception('unable to access to <%s>' % fn)
                return True

        return basename(fn).startswith('.')