[Python-Dev] Returning Windows file attribute information via os.stat() (original) (raw)

Ben Hoyt benhoyt at gmail.com
Tue Jun 10 14:20:56 CEST 2014


if hasattr(st, 'stwinattrs') and st.stwinattrs & FILEATTRIBUTEHIDDEN: That could be written more succinctly as: if getattr(st, 'stwinattrs', 0) & FILEATTRIBUTEHIDDEN:

return True return False

Yes, good call. Or one further:

return getattr(st, 'st_winattrs', 0) & FILE_ATTRIBUTE_HIDDEN != 0

-Ben



More information about the Python-Dev mailing list