bug-coreutils
[Top][All Lists]
Advanced

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

Re: [Bug 154602] Re: incorrect cp(1) behaviour upon "mkdir foo; cp -r f


From: Paul Eggert
Subject: Re: [Bug 154602] Re: incorrect cp(1) behaviour upon "mkdir foo; cp -r foo foo"
Date: Mon, 30 Mar 2009 19:48:04 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux)

Jim Meyering <address@hidden> writes:

> I'm confident that POSIX does not require
> cp -r dir dir to create dir/dir ;-)

That's certainly true: an implementation is clearly allowed to (but not
required to) report an error and exit without doing anything when it
sees this example.  However, that's not what GNU cp does, which raises
the issue.

As near as I can figure out, this is a hole in POSIX.  It nowhere
specifies what "cp" should do when inputs and outputs overlap, which
they can in even-more-interesting ways than "cp -R dir dir".  Perhaps
this should be raised with the POSIX folks, but in the meantime I don't
see that GNU cp needs to change as far as conformance goes.




reply via email to

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