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


Groups > comp.lang.python > #90643

Re: Survey -- Move To Trash function in Python?

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!bcyclone02.am1.xlned.com!bcyclone02.am1.xlned.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.029
X-Spam-Evidence '*H*': 0.94; '*S*': 0.00; 'subject:Python': 0.06; 'subject: -- ': 0.07; '"if': 0.09; "system's": 0.09; 'cc:addr :python-list': 0.11; 'deletion': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'phase,': 0.16; 'subject:Move': 0.16; 'substituted': 0.16; 'exception': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'deleted.': 0.24; 'instead.': 0.24; "shouldn't": 0.24; 'cc:2**0': 0.24; '15,': 0.26; 'header:In-Reply- To:1': 0.27; 'raise': 0.29; 'operations,': 0.30; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'file': 0.32; 'fri,': 0.33; "can't": 0.35; 'but': 0.35; 'received:google.com': 0.35; '14,': 0.36; 'subject:?': 0.36; 'should': 0.36; 'application': 0.37; 'sometimes': 0.38; 'pm,': 0.38; 'moving': 0.39; 'delete': 0.39; 'sure': 0.39; 'even': 0.60; 'catch': 0.60; 'deleting': 0.60; 'ian': 0.60; 'truly': 0.60; "you're": 0.61; 'more': 0.64; 'different': 0.65; '2015': 0.84; 'subject:Survey': 0.91; 'to:none': 0.92
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=9K/sQ8iIS0wU/BgulDyfG2F38DmCI7FiQ789uQzE6bU=; b=PalJJlZTEkDgluMmmQS8zy1k9ZkvP/cV4q50neaP5n5qq9AZFo4HkpvSnSXdV2chcM TjcDSD+5qGOFpZMIel929NDc/nvIcRvyna0JZnZxEFdzhvyNWkgM7NLlMhj6UITng1Lh TM79FTs6hYnA5piUzoP5uPP7gPZD6Lv+Awq++fyFkZi8dEf1p7d5TKc/VRwj71NU/ULF zs87oh64J/u9V0G5qtxCoNa+eCreV11lW6mSRUSghORdi82eGdQ0OaUTUH/ZmdiAjMIx msQPTb2eny5FxH470+w5O047VlpuapUqrzMF7/hI6JneC1SUyoy8IHQXcmjJUlG9hMv/ gTrQ==
MIME-Version 1.0
X-Received by 10.107.160.141 with SMTP id j135mr9731796ioe.43.1431658577264; Thu, 14 May 2015 19:56:17 -0700 (PDT)
In-Reply-To <CALwzidkTXnbwcGPa5tK_fV_Rg1B7pX2rVK+0JPVdwLXu+CD7NQ@mail.gmail.com>
References <5554c318$0$12999$c3e8da3$5496439d@news.astraweb.com> <mj2g70$eij$1@reader1.panix.com> <55554ddb$0$12995$c3e8da3$5496439d@news.astraweb.com> <CAPTjJmokNo3e1=LEBBnC_6zQmtP=Smh7bXm-uCsGEew4sKZ52Q@mail.gmail.com> <CALwzidkTXnbwcGPa5tK_fV_Rg1B7pX2rVK+0JPVdwLXu+CD7NQ@mail.gmail.com>
Date Fri, 15 May 2015 12:56:17 +1000
Subject Re: Survey -- Move To Trash function in Python?
From Chris Angelico <rosuav@gmail.com>
Cc Python <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
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.23.1431658586.17265.python-list@python.org> (permalink)
Lines 20
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1431658586 news.xs4all.nl 2853 [2001:888:2000:d::a6]:53576
X-Complaints-To abuse@xs4all.nl
X-Received-Bytes 4447
X-Received-Body-CRC 3807275246
Xref csiph.com comp.lang.python:90643

Show key headers only | View raw


On Fri, May 15, 2015 at 12:49 PM, Ian Kelly <ian.g.kelly@gmail.com> wrote:
> On May 14, 2015 7:55 PM, "Chris Angelico" <rosuav@gmail.com> wrote:
>> (Though when
>> it comes to the bikeshedding phase, I'm sure there'll be some who say
>> "if it can't be trashed, just hard delete it", and others who say "if
>> it can't be trashed, raise an exception". And neither is truly wrong.)
>
> The answer is "raise an exception". Moving to trash and deleting are
> different operations, and one shouldn't be substituted for the other any
> more than a failed attempt to create a hard link should create a soft link
> instead.
>
> If the user wants, they can catch the exception and delete the file instead.
> Recovering from an accidental deletion would be more difficult.

Yes, but sometimes it's at the file system's discretion - particularly
when you're working with network mounts. The application may not even
know that the file got hard deleted.

ChrisA

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


Thread

Survey -- Move To Trash function in Python? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-15 01:45 +1000
  Re: Survey -- Move To Trash function in Python? Grant Edwards <invalid@invalid.invalid> - 2015-05-14 15:49 +0000
    Re: Survey -- Move To Trash function in Python? Chris Angelico <rosuav@gmail.com> - 2015-05-15 01:59 +1000
      Re: Survey -- Move To Trash function in Python? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-15 12:28 +1000
    Re: Survey -- Move To Trash function in Python? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-15 11:37 +1000
      Re: Survey -- Move To Trash function in Python? Chris Angelico <rosuav@gmail.com> - 2015-05-15 11:53 +1000
      Re: Survey -- Move To Trash function in Python? Ian Kelly <ian.g.kelly@gmail.com> - 2015-05-14 20:49 -0600
      Re: Survey -- Move To Trash function in Python? Chris Angelico <rosuav@gmail.com> - 2015-05-15 12:56 +1000
        Re: Survey -- Move To Trash function in Python? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-15 14:09 +1000
          Re: Survey -- Move To Trash function in Python? Chris Angelico <rosuav@gmail.com> - 2015-05-15 14:25 +1000
          Re: Survey -- Move To Trash function in Python? random832@fastmail.us - 2015-05-15 14:27 -0400
            Re: Survey -- Move To Trash function in Python? sohcahtoa82@gmail.com - 2015-05-15 17:04 -0700
          Re: Survey -- Move To Trash function in Python? Chris Angelico <rosuav@gmail.com> - 2015-05-16 04:33 +1000
  Re: Survey -- Move To Trash function in Python? Dave Farrance <DaveFarrance@OMiTTHiSyahooANDTHiS.co.uk> - 2015-05-14 18:32 +0100
    Re: Survey -- Move To Trash function in Python? Grant Edwards <invalid@invalid.invalid> - 2015-05-14 18:11 +0000
      Re: Survey -- Move To Trash function in Python? Chris Warrick <kwpolska@gmail.com> - 2015-05-14 20:43 +0200
      Re: Survey -- Move To Trash function in Python? Ethan Furman <ethan@stoneleaf.us> - 2015-05-14 12:32 -0700
    Re: Survey -- Move To Trash function in Python? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-15 12:03 +1000
      Re: Survey -- Move To Trash function in Python? Terry Reedy <tjreedy@udel.edu> - 2015-05-14 22:27 -0400
  Re: Survey -- Move To Trash function in Python? Ethan Furman <ethan@stoneleaf.us> - 2015-05-14 11:29 -0700
  Re: Survey -- Move To Trash function in Python? iMath <redstone-cold@163.com> - 2015-05-18 03:31 -0700
    Re: Survey -- Move To Trash function in Python? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-05-18 14:46 +0100

csiph-web