From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: bug in copy-directory Date: Fri, 28 Jan 2011 19:28:19 +0100 Message-ID: References: <87ipxaidea.fsf@gmail.com> <87k4hp96g0.fsf@stupidchicken.com> <878vy59ejz.fsf@stupidchicken.com> <87lj25ar3v.fsf@gmail.com> <87hbcsc2zv.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1296239332 26399 80.91.229.12 (28 Jan 2011 18:28:52 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 28 Jan 2011 18:28:52 +0000 (UTC) Cc: Chong Yidong , Michael Albinus , Stefan Monnier , emacs-devel@gnu.org To: Thierry Volpiatto Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 28 19:28:47 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Pit3v-00017I-Bz for ged-emacs-devel@m.gmane.org; Fri, 28 Jan 2011 19:28:47 +0100 Original-Received: from localhost ([127.0.0.1]:60650 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pit3u-0006iw-Sd for ged-emacs-devel@m.gmane.org; Fri, 28 Jan 2011 13:28:46 -0500 Original-Received: from [140.186.70.92] (port=60354 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pit3q-0006iq-1u for emacs-devel@gnu.org; Fri, 28 Jan 2011 13:28:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pit3o-0008EX-Q7 for emacs-devel@gnu.org; Fri, 28 Jan 2011 13:28:41 -0500 Original-Received: from mail-ey0-f169.google.com ([209.85.215.169]:53618) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pit3o-0008EL-Jw for emacs-devel@gnu.org; Fri, 28 Jan 2011 13:28:40 -0500 Original-Received: by eyh6 with SMTP id 6so1719625eyh.0 for ; Fri, 28 Jan 2011 10:28:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=aai6xlYmdrf6DbcP0Ol2x9DLXkWHaQ52DXk5v9L0F+Q=; b=fO1UnAzpebJ+3saJZ4IUSxx1yIglMLE7Eu7S3eEPSnYLonTYbscvDvYHblqZ6dUHsx zvjCauQqaJ/5t/n5qksELJFVyzQHRXmbXPCssH+GURJzxyow17YEdARFfHj8Le/bfhw0 nYqgv8cFKXZ/kJWr6YAhOJUvPbBhPttaCy4MU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=TvdFAdNL5iUTJLfENIYtD7MecxNGP/0Pf4SoD2GYXgailt3LVwXOZvdN6LTXEZSbQd sYitXxd3RBE+Ih6OCdE9YZ/H6lIu36p+OzVfUekT4JTgQi0RuN4CS8Uo5w6ZddWdr1Uv Eonby0Mb2m2gi25M0rc2+N97aAtcd6cU0qNSc= Original-Received: by 10.213.30.20 with SMTP id s20mr5341564ebc.15.1296239319483; Fri, 28 Jan 2011 10:28:39 -0800 (PST) Original-Received: by 10.213.36.11 with HTTP; Fri, 28 Jan 2011 10:28:19 -0800 (PST) In-Reply-To: <87hbcsc2zv.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.215.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:135171 Archived-At: On Fri, Jan 28, 2011 at 7:11 PM, Thierry Volpiatto wrote: > Lennart Borgman writes: > >> On Fri, Jan 28, 2011 at 6:13 PM, Thierry Volpiatto >> wrote: >>>> >>>> Isn't the semantics of "cp" broken + undescribed? >>> No >> >> Yes ;-) >> >>>> I had a directory x1, but no x2. Doing >>>> >>>> =C2=A0 cp -r x1 x2 >>>> >>>> works as I expect it to, i.e. x1 and x2 are identical. >>>> >>>> However after a second >>>> >>>> =C2=A0 cp -r x1 x2 >>>> >>>> there is suddenly a directory x1 inside x2. >>> That's what is expected, imagine with what you expect, x2 is your home >>> directory or /etc, and you copy x1 to it by error... >> >> So? The urge to copy? > So x1 will overwrite your important directory and you will lost all. > So i think cp do the right thing, since a long time as said by Andreas. Sure it does the same thing as before and POSIX did not have much of a mandate to change things. But there are other semantics in use for this problem. If you look at the semantics used by w32 "GUI shell" (Explorer) it handles the situation that x2 exist by creating a new directory with a new name. (Emacs uses that kind of semantic for other things.) I would guess that such "GUI shells" on *nix have similar semantic. Or what do they do?