python判断windows隐藏文件的方法

953次阅读  |  发布于5年以前

1. 通过windows attrib 命令获取文件隐藏属性

复制代码 代码如下:

Syntax
ATTRIB [ + attribute | - attribute ] [pathname] [/S [/D]]

Key

 -    : Clear an attribute OFF

pathname : Drive and/or filename e.g. C:\*.txt
/S : Search the pathname including all subfolders.
/D : Process folders as well

attributes:

    R  Read-only (1)  
    H  Hidden (2)  
    A  Archive (32)  
    S  System (4)

extended attributes:
E Encrypted
C Compressed (128:read-only)
I Not content-indexed
L Symbolic link/Junction (64:read-only)
N Normal (0: cannot be used for file selection)
O Offline
P Sparse file
T Temporary

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8