[Pharo-project] FileReference should throw error when deleting unexisting files?

Schwab,Wilhelm K bschwab at anest.ufl.edu
Mon Jun 11 19:41:20 EDT 2012

I generally default to saying "of course there should be an error."  I much prefer to get my bad news early rather than having to fish around or it after the fact.  Toward that end, I would recommend having #deleteIfAbsent: and #delete that provides an error-raising block and forwards to #deleteifAbsent:.  That is consistent with collections, which are not a bad model/source-of-inspiration for managing directory contents.

Having #ensureDeleted in addition to above does no real harm.  I would prefer that the selector start with "delete" so it appears close to the other methods in browsers, even w/o category filtering - makes it more discoverable.

Just my 2 asCents.


From: pharo-project-bounces at lists.gforge.inria.fr [pharo-project-bounces at lists.gforge.inria.fr] on behalf of Chris Cunningham [cunningham.cb at gmail.com]
Sent: Monday, June 11, 2012 5:55 PM
To: Pharo-project at lists.gforge.inria.fr
Subject: Re: [Pharo-project] FileReference should throw error when deleting unexisting files?

On Mon, Jun 11, 2012 at 2:32 PM,  <petton.nicolas at gmail.com> wrote:
> Maybe #ensureDeleted would be better?
> Nico
I like #ensureDeleted (make sure it doesn't exist)

More information about the Pharo-dev mailing list