Jiffy.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:Jiffy 作者: h5rdly 项目源码 文件源码
def _get_ntfs_drives_win(self):
        '''Return list of ntfs drives using fsutil fsinfo's volumeinfo. 
        Result after slpit('\r\n'):

        ['Volume Name : Le Shwa',
         'Volume Serial Number : 0xd4d56c89',
         'Max Component Length : 255',
         'File System Name : NTFS',     --> index #3 --> split(':') --> index #1 
         'Is ReadWrite',....       ]'''

        ntfs_drives=[]
        win_drive_list=(chr(a)+ u':' for a in range(ord('A'), ord('Z')) if self.exists(chr(a)+':'))
        for drive in self.drives:
            volume_info=Popen(('fsutil', 'fsinfo', 'volumeInfo', drive), stdout=PIPE).communicate()[0]
            file_system=volume_info.split('\r\n')[3].split(' : ')[1]
            if file_system=='NTFS':
                ntfs_drives.append(drive)

        return ntfs_drives
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号