HDD Burn In with Python

Neil Hodgson nhodgson at bigpond.net.au
Wed Dec 31 01:22:17 CET 2003


David M. Wilson:
> If your targets are only *NIX/x86 and OS/X, then you are at least
> confined to a unix-style environment, which makes getting low-level
> disk access easy and the only problem is working out device file
> names.

   On Windows NT or XP the drives have names like \\.\PhysicalDrive0 so the
following Python code can do some reading from a particular position on the
first physical disk:

f = open("\\\\.\\PhysicalDrive0", "rb")
f.seek(1800*1024*1024)
for i in range(8000000):
    x = f.read(1024)

   Neil






More information about the Python-list mailing list