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


Groups > comp.lang.python > #33283

Re: Detect file is locked - windows

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:file': 0.07; 'errno': 0.09; 'ioerror': 0.09; 'open()': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'throw': 0.09; 'url:peps': 0.09; 'cases': 0.15; "'w'": 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:windows': 0.16; 'wrote:': 0.17; 'url:dev': 0.17; 'thanks,': 0.18; 'permission': 0.20; 'file.': 0.20; 'trying': 0.21; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.28; 'mode': 0.30; 'url:python': 0.32; 'file': 0.32; 'from:addr:yahoo.co.uk': 0.32; 'not.': 0.32; 'to:addr:python- list': 0.33; 'another': 0.33; 'open': 0.35; 'received:org': 0.36; 'url:org': 0.36; 'anything': 0.36; 'does': 0.37; 'two': 0.37; 'subject:: ': 0.38; 'mark': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'application': 0.40; 'header:Received:5': 0.40; 'help': 0.40; 'here': 0.65; 'distinguish': 0.84; 'received:2': 0.91; 'ali': 0.95
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: Detect file is locked - windows
Date Wed, 14 Nov 2012 01:14:59 +0000
References <2af436e3-1336-42ae-aa2f-9e33135a3f2c@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host host-2-98-197-9.as13285.net
User-Agent Mozilla/5.0 (Windows NT 6.0; rv:16.0) Gecko/20121026 Thunderbird/16.0.2
In-Reply-To <2af436e3-1336-42ae-aa2f-9e33135a3f2c@googlegroups.com>
X-Antivirus avast! (VPS 121113-1, 13/11/2012), Outbound message
X-Antivirus-Status Clean
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 <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3659.1352855611.27098.python-list@python.org> (permalink)
Lines 16
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1352855611 news.xs4all.nl 6863 [2001:888:2000:d::a6]:46067
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:33283

Show key headers only | View raw


On 14/11/2012 00:33, Ali Akhavan wrote:
> I am trying to open a file in 'w' mode open('file', 'wb'). open() will throw with IOError with errno 13 if the file is locked by another application or if user does not have permission to open/write to the file.
>
> How can I distinguish these two cases ? Namely, if some application has the file open or not.
>
> Thanks,
> nomadali
>

Anything here help http://www.python.org/dev/peps/pep-3151/ ?

-- 
Cheers.

Mark Lawrence.

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


Thread

Detect file is locked - windows Ali Akhavan <a.akhavan.b@gmail.com> - 2012-11-13 16:33 -0800
  Re: Detect file is locked - windows Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-11-14 01:14 +0000
    Re: Detect file is locked - windows Hans Mulder <hansmu@xs4all.nl> - 2012-11-14 09:55 +0100
      Re: Detect file is locked - windows Tim Golden <mail@timgolden.me.uk> - 2012-11-14 09:06 +0000
  Re: Detect file is locked - windows Tim Golden <mail@timgolden.me.uk> - 2012-11-14 10:02 +0000
    Re: Detect file is locked - windows Hans Mulder <hansmu@xs4all.nl> - 2012-11-14 12:51 +0100
      Re: Detect file is locked - windows Tim Golden <mail@timgolden.me.uk> - 2012-11-14 12:09 +0000
    Re: Detect file is locked - windows aahz@pythoncraft.com (Aahz) - 2012-11-15 08:01 -0800
  Re: Detect file is locked - windows Tim Golden <mail@timgolden.me.uk> - 2012-11-14 11:50 +0000

csiph-web