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
评论列表
文章目录