I know in linux it is as simple as /dev/sda but in Windows how do you open a disk and start reading data at the low level?
In python I've tried:
f = open("K:", "r")
and I get this error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IOError: [Errno 13] Permission denied: 'K:'
I get this error even as administrator.
If you're running Windows 11, Windows 10, or Windows 8, you can view all mounted drives in File Explorer. You can open File Explorer by pressing Windows key + E . In the left pane, select This PC, and all drives are shown on the right.
To start Disk Management:Click Start -> Run -> type compmgmt. msc -> click OK. Alternatively, right-click on the My Computer icon and select 'Manage'. In the console tree, click Disk Management.
From http://support.microsoft.com/kb/100027
To open a physical hard drive for direct disk access (raw I/O) in a Win32-based application, use a device name of the form
\\.\PhysicalDriveN
where N is 0, 1, 2, and so forth, representing each of the physical drives in the system.
To open a logical drive, direct access is of the form
\\.\X:
where X: is a hard-drive partition letter, floppy disk drive, or CD-ROM drive.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With