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

Path csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <khanta@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.034
X-Spam-Evidence '*H*': 0.93; '*S*': 0.00; 'subject:Python': 0.06; 'error:': 0.07; 'python:': 0.09; 'windows': 0.15; 'os:': 0.16; 'possible?': 0.16; 'trying': 0.19; 'permission': 0.26; 'message- id:@mail.gmail.com': 0.30; 'code': 0.31; 'running': 0.33; 'raw': 0.33; 'but': 0.35; 'received:google.com': 0.35; 'disk': 0.36; 'skip:o 20': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'skip:o 30': 0.61; 'physical': 0.72; '8.1': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=kd8l+RgmWu+AabSqh1+vCw861WbuDccACyRCZGoBy7M=; b=DSInFTwCeKHoknkhj/JVyUP83gPMO09qdRajvKWWlyNK5ab4K/W0NEV9yxuY6rsIgi Ee69kt52XaJg1wd9aKHixNF9nOhRrZTL/5TGR4f05st69bTeo2ozX5j9C6mdnWz2FXKW Dl/dCER4pZMJYuzbU4K2xwRfbJI+cZaazIH66H4SpexYQ20Hpeh24+kj+tMbQdfcpc/V W6sLk1y2mIHsJzq6GyrXcMPaEZvkck7eTWz1UDHvjrmRVeHGrUmEBV2ya3BM/ygquJbH 8ucY70ytYKYkU+5a9jpkLXNT8TNkV9241af/pNmiLeXe89Qu0rBi9tLjzaNGsuUn67dB 7J7w==
X-Received by 10.140.82.175 with SMTP id h44mr1530945qgd.68.1392813762685; Wed, 19 Feb 2014 04:42:42 -0800 (PST)
MIME-Version 1.0
From khanta <khanta@gmail.com>
Date Wed, 19 Feb 2014 07:42:02 -0500
Subject Win32 Write RAW Physical Disk Python 3.3.2
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-Mailman-Approved-At Wed, 19 Feb 2014 14:30:26 +0100
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.7148.1392816628.18130.python-list@python.org> (permalink)
Lines 30
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1392816628 news.xs4all.nl 2892 [2001:888:2000:d::a6]:47402
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:66688

Show key headers only | 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