From unknown Sat Jun 21 05:15:44 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8381: cp inconsistency Resent-From: Thomas Hofmann Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Wed, 30 Mar 2011 12:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 8381 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 8381@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.130148814725682 (code B ref -1); Wed, 30 Mar 2011 12:30:02 +0000 Received: (at submit) by debbugs.gnu.org; 30 Mar 2011 12:29:07 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q4uWI-0006gB-Ij for submit@debbugs.gnu.org; Wed, 30 Mar 2011 08:29:07 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q4uA6-00067N-Ce for submit@debbugs.gnu.org; Wed, 30 Mar 2011 08:06:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q4u9v-0004We-4d for submit@debbugs.gnu.org; Wed, 30 Mar 2011 08:06:04 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RFC_ABUSE_POST, T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:34849) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q4u9v-0004WU-25 for submit@debbugs.gnu.org; Wed, 30 Mar 2011 08:05:59 -0400 Received: from [140.186.70.92] (port=47634 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4u0k-0001x0-ET for bug-coreutils@gnu.org; Wed, 30 Mar 2011 07:56:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q4u0P-0002iP-9M for bug-coreutils@gnu.org; Wed, 30 Mar 2011 07:56:10 -0400 Received: from mail-qw0-f41.google.com ([209.85.216.41]:34113) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q4u0P-0002iL-0o for bug-coreutils@gnu.org; Wed, 30 Mar 2011 07:56:09 -0400 Received: by qwa26 with SMTP id 26so970232qwa.0 for ; Wed, 30 Mar 2011 04:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=SKRzI7+4fjC88Qsw6UhJqSkjjsKYuBiH0wiUYlIxHoM=; b=W68KTXhAZejhW0nKBFs0H3MAqqYqmBCfIyIXzi+/SAah70lTMq2rBpWcdmbXSmvObo 53A0o6j/c5fSdTzpfBT+qBXo6FnSOId7k8c9JSznFUNpAmDO8BMmFNYrQmkHiqD6dgR4 PqwdEz3fXXy/6m2ig9ghUEf3xOjxTwYzOzeL4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=fIiQYsTie/plPVuaYYaSjiXrGi/lH03KYpP4s3dFpX7rCBjmqD8Y6dx1QTd9sfKetz 9B9z6/aJtHN5Xf70RkwPnW/c58eG9UKVbBdGX9gW1HvjY6Uai1ligz4jIu3Scg6J1g/0 Z+ET+EOgacOTqGB/Wjdh8bq9A5DuYa9DWNhTQ= MIME-Version: 1.0 Received: by 10.229.43.142 with SMTP id w14mr941992qce.27.1301486168248; Wed, 30 Mar 2011 04:56:08 -0700 (PDT) Received: by 10.229.190.133 with HTTP; Wed, 30 Mar 2011 04:56:08 -0700 (PDT) In-Reply-To: References: Date: Wed, 30 Mar 2011 13:56:08 +0200 X-Google-Sender-Auth: IbCfmuGhRiyYbhNrSopi7TEotag Message-ID: From: Thomas Hofmann Content-Type: text/plain; charset=UTF-8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -5.9 (-----) X-Mailman-Approved-At: Wed, 30 Mar 2011 08:29:04 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) Hello, two issues: 1) manpage of cp contains obsolete email-address for bug-reporting 2) cp inconsistency when copying a directory to a) a non existing directory, or b) to an existing directory. Further elaborated below. cp -a SOME_DIR NOT_YET_EXISTING_DIR results in a new directory directly containing each entry of SOME_DIR while: CP -a SOME_DIR EXISTING_DIR results in EXISTING_DIR/SOME_DIR The first result seems to be a reasonable outcome in both cases. Appending "/" to the directory-names should lead to the same result. While appending "/." to the target-directory would change the meaning, and rather lead to the result of the observed second version. Kind regards, Thomas p.s. cp (GNU coreutils) 7.1 From unknown Sat Jun 21 05:15:44 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8381: cp inconsistency Resent-From: Eric Blake Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Wed, 30 Mar 2011 14:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8381 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Thomas Hofmann Cc: 8381@debbugs.gnu.org Received: via spool by 8381-submit@debbugs.gnu.org id=B8381.13014938364782 (code B ref 8381); Wed, 30 Mar 2011 14:04:02 +0000 Received: (at 8381) by debbugs.gnu.org; 30 Mar 2011 14:03:56 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q4w03-0001F4-2a for submit@debbugs.gnu.org; Wed, 30 Mar 2011 10:03:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q4w00-0001Es-RS for 8381@debbugs.gnu.org; Wed, 30 Mar 2011 10:03:54 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2UE3kWe010245 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 30 Mar 2011 10:03:46 -0400 Received: from [10.3.113.104] (ovpn-113-104.phx2.redhat.com [10.3.113.104]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p2UE3joj029236; Wed, 30 Mar 2011 10:03:45 -0400 Message-ID: <4D933841.5000306@redhat.com> Date: Wed, 30 Mar 2011 08:03:45 -0600 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.9 MIME-Version: 1.0 References: In-Reply-To: X-Enigmail-Version: 1.1.2 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigF8E715E1CDB2FC237EC8B813" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Spam-Score: -10.3 (----------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -10.3 (----------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigF8E715E1CDB2FC237EC8B813 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/30/2011 05:56 AM, Thomas Hofmann wrote: > Hello, >=20 > two issues: > 1) manpage of cp contains obsolete email-address for bug-reporting The man page is generated from 'cp --help' output; on my Fedora 14 machine, I see this for 'man cp' REPORTING BUGS Report cp bugs to bug-coreutils@gnu.org =2E.. GNU coreutils 8.5 November 2010 CP(1) If the man page doesn't end with the same version as 'cp --version', then your man pages are out of date, and that is an installation problem on your end (or perhaps something you should take up with your distro); if it _is_ up-to-date, then the reporting bugs address should match. If it doesn't, then paste what you actually see before claiming that it is wrong. > 2) cp inconsistency when copying a directory to a) a non existing > directory, or b) to an existing directory. Further elaborated below. >=20 > cp -a SOME_DIR NOT_YET_EXISTING_DIR >=20 > results in a new directory directly containing each entry of SOME_DIR >=20 > while: > CP -a SOME_DIR EXISTING_DIR Did you mean 'cp' instead of 'CP'? >=20 > results in EXISTING_DIR/SOME_DIR This is not a bug - the dual behavior is mandated by POSIX, which specifically requires that cp first stat() the last argument, then act differently depending on whether that argument was an existing directory or not. >=20 > The first result seems to be a reasonable outcome in both cases. > Appending "/" to the directory-names should lead to the same result. To the source or to the destination, or to both? > While appending "/." to the target-directory would change the meaning, > and rather lead to the result of the observed second version. I'm not sure I follow what you think is wrong or unintuitive. So the best I can do is state what POSIX requires, and that I believe that GNU cp meets those requirements: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/cp.html The first synopsis form is denoted by two operands, neither of which are existing files of type directory. The cp utility shall copy the contents of source_file (or, if source_file is a file of type symbolic link, the contents of the file referenced by source_file) to the destination path named by target_file. The second synopsis form is denoted by two or more operands where the -R option is not specified and the first synopsis form is not applicable. It shall be an error if any source_file is a file of type directory, if target does not exist, or if target does not name a directory. The cp utility shall copy the contents of each source_file (or, if source_file is a file of type symbolic link, the contents of the file referenced by source_file) to the destination path named by the concatenation of target, a single character if target did not end in a , and the last component of source_file. The third synopsis form is denoted by two or more operands where the -R option is specified. The cp utility shall copy each file in the file hierarchy rooted in each source_file to a destination path named as follo= ws: * If target exists and names an existing directory, the name of the corresponding destination path for each file in the file hierarchy shall be the concatenation of target, a single character if target did not end in a , and the pathname of the file relative to the directory containing source_file. * If target does not exist and two operands are specified, the name of the corresponding destination path for source_file shall be target; the name of the corresponding destination path for all other files in the file hierarchy shall be the concatenation of target, a character, and the pathname of the file relative to source_file. --=20 Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org --------------enigF8E715E1CDB2FC237EC8B813 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJNkzhBAAoJEKeha0olJ0NqetYIAJRExLtapRoabZd/Ucfp/9DL AAcvDi0bU/ozM+QdAZuPkLnRfWvKYKSnHqIb2P6A1PXfaY+xqgoDgM45Y3N9R3ES qiM/Xd7402MtTBCJKTDtkkjFDDOBiZOFR0ILPx21jk3jrfZ7GpSFl1aCTIrx3ucS wfjzCJBnipXhLhyYQY9wuVH7VL7ydgCR1jntPgyLjmuKD3I+bQyMvwxPjk6cTXGK X2EKKp+kh9nglDmFcBDyHqogE4jQ9qBhsal8b7Eat8luElG+7jNCvIz66BpPIDD3 SGFSZfp8c48JLjr4H2InPCJOjOFSZVT4pu5NrGOyICv1XSEuHWtTjHGDZTUms04= =vWEy -----END PGP SIGNATURE----- --------------enigF8E715E1CDB2FC237EC8B813-- From unknown Sat Jun 21 05:15:44 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Thomas Hofmann Subject: bug#8381: closed (Re: bug#8381: cp inconsistency) Message-ID: References: <4D9339E3.8090400@draigBrady.com> X-Gnu-PR-Message: they-closed 8381 X-Gnu-PR-Package: coreutils Reply-To: 8381@debbugs.gnu.org Date: Wed, 30 Mar 2011 14:12:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1301494322-5542-1" This is a multi-part message in MIME format... ------------=_1301494322-5542-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #8381: cp inconsistency which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 8381@debbugs.gnu.org. --=20 8381: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D8381 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1301494322-5542-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 8381-done) by debbugs.gnu.org; 30 Mar 2011 14:11:17 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q4w7A-0001QU-HO for submit@debbugs.gnu.org; Wed, 30 Mar 2011 10:11:16 -0400 Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1Q4w78-0001QD-5d for 8381-done@debbugs.gnu.org; Wed, 30 Mar 2011 10:11:15 -0400 Received: (qmail 80247 invoked from network); 30 Mar 2011 14:11:07 -0000 Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218) by mail1.slb.deg.dub.stisp.net with SMTP; 30 Mar 2011 14:11:07 -0000 Message-ID: <4D9339E3.8090400@draigBrady.com> Date: Wed, 30 Mar 2011 15:10:43 +0100 From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 MIME-Version: 1.0 To: 8381-done@debbugs.gnu.org Subject: Re: bug#8381: cp inconsistency References: In-Reply-To: X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 8381-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) On 30/03/11 12:56, Thomas Hofmann wrote: > Hello, > > two issues: > 1) manpage of cp contains obsolete email-address for bug-reporting That is fixed in current versions > 2) cp inconsistency when copying a directory to a) a non existing > directory, or b) to an existing directory. Further elaborated below. > > cp -a SOME_DIR NOT_YET_EXISTING_DIR > > results in a new directory directly containing each entry of SOME_DIR > > while: > CP -a SOME_DIR EXISTING_DIR > > results in EXISTING_DIR/SOME_DIR > > The first result seems to be a reasonable outcome in both cases. > Appending "/" to the directory-names should lead to the same result. > While appending "/." to the target-directory would change the meaning, > and rather lead to the result of the observed second version. So you would like cp -a dir dest_dir # copy dir/* to dest_dir/ cp -a dir dest_dir/ # copy dir to dest_dir/ That seems a bit subtle to me. Currently one can get the first behavior using `cp -aT` so I'll close this. Note also the related: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7450 cheers, Pádraig. ------------=_1301494322-5542-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 30 Mar 2011 12:29:07 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q4uWI-0006gB-Ij for submit@debbugs.gnu.org; Wed, 30 Mar 2011 08:29:07 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q4uA6-00067N-Ce for submit@debbugs.gnu.org; Wed, 30 Mar 2011 08:06:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q4u9v-0004We-4d for submit@debbugs.gnu.org; Wed, 30 Mar 2011 08:06:04 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RFC_ABUSE_POST, T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:34849) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q4u9v-0004WU-25 for submit@debbugs.gnu.org; Wed, 30 Mar 2011 08:05:59 -0400 Received: from [140.186.70.92] (port=47634 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4u0k-0001x0-ET for bug-coreutils@gnu.org; Wed, 30 Mar 2011 07:56:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q4u0P-0002iP-9M for bug-coreutils@gnu.org; Wed, 30 Mar 2011 07:56:10 -0400 Received: from mail-qw0-f41.google.com ([209.85.216.41]:34113) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q4u0P-0002iL-0o for bug-coreutils@gnu.org; Wed, 30 Mar 2011 07:56:09 -0400 Received: by qwa26 with SMTP id 26so970232qwa.0 for ; Wed, 30 Mar 2011 04:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=SKRzI7+4fjC88Qsw6UhJqSkjjsKYuBiH0wiUYlIxHoM=; b=W68KTXhAZejhW0nKBFs0H3MAqqYqmBCfIyIXzi+/SAah70lTMq2rBpWcdmbXSmvObo 53A0o6j/c5fSdTzpfBT+qBXo6FnSOId7k8c9JSznFUNpAmDO8BMmFNYrQmkHiqD6dgR4 PqwdEz3fXXy/6m2ig9ghUEf3xOjxTwYzOzeL4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=fIiQYsTie/plPVuaYYaSjiXrGi/lH03KYpP4s3dFpX7rCBjmqD8Y6dx1QTd9sfKetz 9B9z6/aJtHN5Xf70RkwPnW/c58eG9UKVbBdGX9gW1HvjY6Uai1ligz4jIu3Scg6J1g/0 Z+ET+EOgacOTqGB/Wjdh8bq9A5DuYa9DWNhTQ= MIME-Version: 1.0 Received: by 10.229.43.142 with SMTP id w14mr941992qce.27.1301486168248; Wed, 30 Mar 2011 04:56:08 -0700 (PDT) Received: by 10.229.190.133 with HTTP; Wed, 30 Mar 2011 04:56:08 -0700 (PDT) In-Reply-To: References: Date: Wed, 30 Mar 2011 13:56:08 +0200 X-Google-Sender-Auth: IbCfmuGhRiyYbhNrSopi7TEotag Message-ID: Subject: Re: cp inconsistency From: Thomas Hofmann To: bug-coreutils@gnu.org Content-Type: text/plain; charset=UTF-8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 30 Mar 2011 08:29:04 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) Hello, two issues: 1) manpage of cp contains obsolete email-address for bug-reporting 2) cp inconsistency when copying a directory to a) a non existing directory, or b) to an existing directory. Further elaborated below. cp -a SOME_DIR NOT_YET_EXISTING_DIR results in a new directory directly containing each entry of SOME_DIR while: CP -a SOME_DIR EXISTING_DIR results in EXISTING_DIR/SOME_DIR The first result seems to be a reasonable outcome in both cases. Appending "/" to the directory-names should lead to the same result. While appending "/." to the target-directory would change the meaning, and rather lead to the result of the observed second version. Kind regards, Thomas p.s. cp (GNU coreutils) 7.1 ------------=_1301494322-5542-1-- From unknown Sat Jun 21 05:15:44 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8381: closed (Re: bug#8381: cp inconsistency) Resent-From: Thomas Hofmann Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Wed, 30 Mar 2011 15:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8381 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 8381@debbugs.gnu.org Received: via spool by 8381-submit@debbugs.gnu.org id=B8381.130150051714302 (code B ref 8381); Wed, 30 Mar 2011 15:56:02 +0000 Received: (at 8381) by debbugs.gnu.org; 30 Mar 2011 15:55:17 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q4xjo-0003id-7P for submit@debbugs.gnu.org; Wed, 30 Mar 2011 11:55:16 -0400 Received: from mail-qy0-f172.google.com ([209.85.216.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q4xHT-00034c-1t for 8381@debbugs.gnu.org; Wed, 30 Mar 2011 11:25:59 -0400 Received: by qyk29 with SMTP id 29so2786661qyk.3 for <8381@debbugs.gnu.org>; Wed, 30 Mar 2011 08:25:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=uhKVf+lsm+UEt14tHJK7HNfoctkAe+QRy5bCPm9bbTI=; b=s3xS3Eq1rx+AXH6cnql4xrHSRTiZF+U46na5yc3DuBC5fB5PIXQZKldt5OiWS0L40Q jSbV1t0gepkJtx7e0PhQhINI5dpPqpGiieS8/+xJq/LClCsDARdE+HQbSQSeEFzRlMcR HwiZc2IKfCdDEH+Qor7WS/LMZLcjcXZ/OWMWo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=v8QJsUhrqyYQPYtir/tFET5r8CpCQ1kQLE+gD3MOHM+17rxXkoIq2L/L/QCuLbACFE JHzDYYz/lO4jbTEWxFdvRtTeNlbAsu4JYiVJhOLB+XZlcS1QZgtWz3D9cn2RnmlzD5gL HOkxhdDNbUIRoCL7qcSgKVHlMPx2AqWQI3cWw= MIME-Version: 1.0 Received: by 10.229.45.203 with SMTP id g11mr1188864qcf.65.1301498753348; Wed, 30 Mar 2011 08:25:53 -0700 (PDT) Received: by 10.229.190.133 with HTTP; Wed, 30 Mar 2011 08:25:53 -0700 (PDT) In-Reply-To: References: <4D9339E3.8090400@draigBrady.com> Date: Wed, 30 Mar 2011 17:25:53 +0200 X-Google-Sender-Auth: zzW-kqaiCyds7U9WPwh68nHfU4U Message-ID: From: Thomas Hofmann Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -4.8 (----) X-Mailman-Approved-At: Wed, 30 Mar 2011 11:55:15 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.4 (----) >> 2) cp inconsistency when copying a directory to a) a non existing >> directory, or b) to an existing directory. Further elaborated below. >> >> cp -a SOME_DIR NOT_YET_EXISTING_DIR >> >> results in a new directory directly containing each entry of SOME_DIR >> >> while: >> CP -a SOME_DIR EXISTING_DIR >> >> results in EXISTING_DIR/SOME_DIR >> >> The first result seems to be a reasonable outcome in both cases. >> Appending "/" to the directory-names should lead to the same result. >> While appending "/." to the target-directory would change the meaning, >> and rather lead to the result of the observed second version. > > So you would like > > cp -a dir dest_dir =C2=A0# copy dir/* to dest_dir/ > cp -a dir dest_dir/ # copy dir to dest_dir/ No. I would like that a) cp -a dir dest_dir does what b) cp -a dir previously_not_existing_dest_dir does already Consider you have the following directory layout: / /dir /dest_dir Then - at least in v. 7.1 of coreutils - b) results in the new directory layout: / /dir /dest_dir /previously_not_existing_dest_dir while a) would result in: / /dir /dest_dir/dir Try it. The described behaviour is at least counter intuitive. In order to copy a directory and its contents _into_ another directory cp -a dir dest_dir/. already works and is an appropriate statement to express what is meant. The appended "/." makes it clear that the target is the content of the directory and not the directory itself. While it seems to be a slight difference it is actually not. Please reason about this. Kind regards, Thomas From unknown Sat Jun 21 05:15:44 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8381: closed (Re: bug#8381: cp inconsistency) Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Wed, 30 Mar 2011 19:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8381 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Thomas Hofmann Cc: 8381@debbugs.gnu.org Reply-To: 8381@debbugs.gnu.org Received: via spool by 8381-submit@debbugs.gnu.org id=B8381.13015140761235 (code B ref 8381); Wed, 30 Mar 2011 19:42:01 +0000 Received: (at 8381) by debbugs.gnu.org; 30 Mar 2011 19:41:16 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q51GW-0000Js-GE for submit@debbugs.gnu.org; Wed, 30 Mar 2011 15:41:16 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q51GT-0000Jf-Lj for 8381@debbugs.gnu.org; Wed, 30 Mar 2011 15:41:14 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 69B8C39E80F8; Wed, 30 Mar 2011 12:41:07 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oTqJATfkcNmz; Wed, 30 Mar 2011 12:41:07 -0700 (PDT) Received: from [131.179.64.200] (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 15EC039E80F0; Wed, 30 Mar 2011 12:41:07 -0700 (PDT) Message-ID: <4D938752.1070600@cs.ucla.edu> Date: Wed, 30 Mar 2011 12:41:06 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Thunderbird/3.1.9 MIME-Version: 1.0 References: <4D9339E3.8090400@draigBrady.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -3.2 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.2 (---) On 03/30/2011 08:25 AM, Thomas Hofmann wrote: > I would like that > a) cp -a dir dest_dir > does what > b) cp -a dir previously_not_existing_dest_dir > does already Doesn't "cp -aT dir dest_dir" do what you want?