[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Poll: what should happen when -delete fails?

From: John Cowan
Subject: Re: Poll: what should happen when -delete fails?
Date: Fri, 24 Aug 2007 12:49:11 -0400
User-agent: Mutt/1.5.13 (2006-08-11)

Eric Blake scripsit:

> > 1. If unlink or rmdir fails, should the -delete action return true or false?

False, I'd say, so you can write -delete -o -dothisorthat.

> > 2. If -delete returns false because it fails, should find also return 
> > nonzero?

I lean toward no, but I'm not too sure.  I would never depend on find's return
value in any case because it is kept deliberately vague.

> > 3. Should -delete issue a message on stderr if it fails, or (on the
> > other hand) should it be possible for the caller to choose how the
> > message is phrased by doing something like this?

Print a message always.  Being able to issue a custom message is much less
important than being notified that a particular deletion failed.

> 4. Should -delete imply -depth, be forbidden unless -depth was specified,
> or be allowed to attempt operation without -depth (in which case deleting
> directory hierarchies will fail because the rmdir is attempted before the
> contents of the directory)?

Imply -depth.

I would add:

5. Should -delete do a 'rm -rf' if the directory being deleted is non-empty?

I'd say yes; this allows you e.g. to look in a directory tree for directories
named 'temp' and delete them no matter what their contents.

We pledge allegiance to the penguin             John Cowan
and to the intellectual property regime         address@hidden
for which he stands, one world under            http://www.ccil.org/~cowan
Linux, with free music and open source
software for all.               --Julian Dibbell on Brazil, edited

reply via email to

[Prev in Thread] Current Thread [Next in Thread]