bug-coreutils
[Top][All Lists]
Advanced

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

bug#36831: enhance 'directory not empty' message


From: Erik Auerswald
Subject: bug#36831: enhance 'directory not empty' message
Date: Thu, 1 Aug 2019 10:32:09 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Hi,

On Wed, Jul 31, 2019 at 04:05:05PM -0600, Assaf Gordon wrote:
> On Mon, Jul 29, 2019 at 06:50:46PM -0500, Paul Eggert wrote:
> > On 7/29/19 1:28 AM, Assaf Gordon wrote:
> > > +      if (rename_errno == ENOTEMPTY || rename_errno == EEXIST)
> > > +        {
> > > +          error (0, 0, _("cannot move %s to %s: Target directory not 
> > > empty"),
> > > +                 quoteaf_n (0, src_name), quoteaf_n (1, dst_name));
> > 
> > Although this is an improvement, it is not general enough, as other errno
> > values are relevant only for the destination. Better would be to have a
> > special case for errno values that matter only for the destination, and use
> > the existing code for errno values where we don't know whether the problem
> > is the source or the destination. Something like the attached, say.
> 
> > +            case EDQUOT: case EEXIST: case EISDIR: case ENOSPC: case 
> > ENOTEMPTY:
> > +              error (0, rename_errno, "%s", quotearg_colon (dst_name));
> > +              break;
> > +
> 
> [...]
> An explicit error explicitly saying "cannot move", and mention the source and
> destination, and also "blames" the target directory seems the most
> user-friendly and least ambiguous.

I agree with this reasoning and prefer Assaf's error message improvement.

Thanks,
Erik
-- 
If you're willing to restrict the flexibility of your approach,
you can almost always do something better.
                        -- John Carmack





reply via email to

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