How can I access the file system and sector of a hard disk drive by C++?
问题 How can I read a sector of a hard disk drive, access the file system and block or cluster of a file, list of bad blocks (FAT) or cluster file (NTFS)? Or access the list of free blocks (FAT) or cluster bitmap (NTFS)? 回答1: You can use the CreateFile API to open a physical disk by specifying a special file name (e.g. "\\.\PhysicalDrive0" ) -- see the section "Physical Disks and Volumes" in the CreateFile MSDN documentation. Be very careful though, especially with write operations -- you can