Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #66688

Win32 Write RAW Physical Disk Python 3.3.2

From khanta <khanta@gmail.com>
Date 2014-02-19 07:42 -0500
Subject Win32 Write RAW Physical Disk Python 3.3.2
Newsgroups comp.lang.python
Message-ID <mailman.7148.1392816628.18130.python-list@python.org> (permalink)

Show all headers | View raw


Hello,
 I am trying to write to the raw physical disk on Windows 8.1 but I
get an error:
PermissionError: [Errno 13] Permission denied: '\\\\.\\PHYSICALDRIVE2\\\\'

OS: Windows 8.1
Python: 3.3.2
Drive is a USB drive
Running as administrator

Code Snippet:

       with open(r"\\.\PHYSICALDRIVE2\\", "rb+") as f:  #Writing Binary!
            f.seek(unallocatedoffset + 0)
            f.write(t1)


or

        with open('\\\\.\\PHYSICALDRIVE2\\', "rb+") as f:  #Writing Binary!
            f.seek(unallocatedoffset + 0)
            f.write(t1)

or

f = os.fdopen(os.open('\\\\.\\PHYSICALDRIVE2\\' os.O_CREAT |
os.O_WRONLY | os.O_APPEND | os.O_EXCL))


Any suggestions?  Is it possible?

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Win32 Write RAW Physical Disk Python 3.3.2 khanta <khanta@gmail.com> - 2014-02-19 07:42 -0500
  Re: Win32 Write RAW Physical Disk Python 3.3.2 khanta@gmail.com - 2014-02-21 13:32 -0800
    Re: Win32 Write RAW Physical Disk Python 3.3.2 Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-21 21:42 +0000

csiph-web