bug-coreutils
[Top][All Lists]
Advanced

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

Re: ACL patch feedback


From: Jim Meyering
Subject: Re: ACL patch feedback
Date: Thu, 24 Nov 2005 23:32:16 +0100

James Youngman <address@hidden> wrote:
> On Thu, Nov 24, 2005 at 02:31:12PM +0100, Jim Meyering wrote:
>> Here's some feedback:
> Here's some feedback feedback :)
>
>> [assuming there's a good reason for --attributes=REGEX, ]
>> With the XATTR changes, copy.c's copy_extended_attributes
>> exits if it encounters an invalid xattr regexp.  It'd be better
>> not to do that.  cp and mv should continue processing
>> remaining command-line arguments even if there's a failure
>> with a preceding one.
>
> I haven't read the patch, but are you sure about this?  If I want cp
> to do something specific and it can't do it or my request was wrongly
> formed, I'd prefer it to exit with a nonzero status, and preferably
> without having done anything at all.
>
> The only circumstances where I would want cp (or, pretty much, any
> other tool) to continue past a failure would be Where my exact request
> could not be fufilled, but where the actual action taken was the
> nearest that could sensibly be achieved (i.e. it came as close as was
> possible) and no real data loss will occur if I assume complete
> success.

Hi James,

Are you suggesting that cp exit immediately upon the first
failure to copy?

If either cp or mv encounters an error while processing a command-line
argument, it must report it (usually), note the failure so as to ensure
a nonzero exit status, and continue processing any remaining arguments.
Ignoring the possibility of xmalloc/xreadlink failure, cp and mv currently
are compatible with most other versions of those programs, and conform
to POSIX in this respect.

You don't really want to change such a long-standing tradition, do you?

The point I was making above is that if there's a problem
anywhere in copy.c, then it should be signaled by returning
an indication of what went wrong (so the caller can proceed),
not by exiting directly.

I'm not sure what you're suggesting, since you admit that
you like it when `cp a no-such c dest-dir' copies `c', even
though it failed to copy a preceding nonexistent `no-such' argument --
since it exits nonzero.

Jim




reply via email to

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