From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sven Joachim Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: Re: Recursive copies in Dired do not preserve directory permissions Date: Wed, 31 Oct 2007 18:01:36 +0100 Message-ID: <87sl3rcj67.fsf@gmx.de> References: <874pgldhhu.fsf@gmx.de> <87wst8fmfh.fsf@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1193851110 27203 80.91.229.12 (31 Oct 2007 17:18:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 31 Oct 2007 17:18:30 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 31 18:18:23 2007 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.50) id 1InHCp-0001OP-8T for ged-emacs-devel@m.gmane.org; Wed, 31 Oct 2007 18:18:15 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1InHCf-0001nc-I8 for ged-emacs-devel@m.gmane.org; Wed, 31 Oct 2007 13:18:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1InHCb-0001lo-T7 for emacs-devel@gnu.org; Wed, 31 Oct 2007 13:18:01 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1InHCY-0001j4-II for emacs-devel@gnu.org; Wed, 31 Oct 2007 13:18:01 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1InHCY-0001io-9H for emacs-devel@gnu.org; Wed, 31 Oct 2007 13:17:58 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1InHCX-0007U6-Tv for emacs-devel@gnu.org; Wed, 31 Oct 2007 13:17:58 -0400 Original-Received: from mx10.gnu.org ([199.232.76.166]) by fencepost.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1InHCX-0001qd-GF for emacs-pretest-bug@gnu.org; Wed, 31 Oct 2007 13:17:57 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1InHCT-0007T5-JC for emacs-pretest-bug@gnu.org; Wed, 31 Oct 2007 13:17:57 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1InGvE-0000k6-GW for emacs-pretest-bug@gnu.org; Wed, 31 Oct 2007 13:00:04 -0400 Original-Received: (qmail invoked by alias); 31 Oct 2007 17:00:02 -0000 Original-Received: from p548659C4.dip.t-dialin.net (EHLO debian) [84.134.89.196] by mail.gmx.net (mp035) with SMTP; 31 Oct 2007 18:00:02 +0100 X-Authenticated: #28250155 X-Provags-ID: V01U2FsdGVkX1+xRlJkGQuxBkmmsEsBUn25hov6QnTcnimX/XUVaJ U7RFdoyRICZcXd In-Reply-To: (Richard Stallman's message of "Sun\, 28 Oct 2007 09\:51\:05 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:82235 gmane.emacs.pretest.bugs:20215 Archived-At: Richard Stallman writes: > It looks correct to me. If nobody shows a problem in 3 days, > please install it. Since I cannot do this myself, would someone please install it into Emacs_22_BASE? Changelog entry and diff follow again: 2007-10-31 Sven Joachim * dired-aux.el (dired-copy-file-recursive): Preserve directory permissions. Index: dired-aux.el =================================================================== RCS file: /sources/emacs/emacs/lisp/dired-aux.el,v retrieving revision 1.151.2.2 diff -u -r1.151.2.2 dired-aux.el --- dired-aux.el 8 Aug 2007 07:38:48 -0000 1.151.2.2 +++ dired-aux.el 27 Oct 2007 17:59:56 -0000 @@ -1162,7 +1162,8 @@ (or (eq recursive 'always) (yes-or-no-p (format "Recursive copies of %s? " from)))) ;; This is a directory. - (let ((files + (let ((mode (file-modes from)) + (files (condition-case err (directory-files from nil dired-re-no-dot) (file-error @@ -1176,7 +1177,9 @@ (if (file-exists-p to) (or top (dired-handle-overwrite to)) (condition-case err - (make-directory to) + (progn + (make-directory to) + (set-file-modes to #o700)) (file-error (push (dired-make-relative from) dired-create-files-failures) @@ -1195,7 +1198,9 @@ (file-error (push (dired-make-relative thisfrom) dired-create-files-failures) - (dired-log "Copying error for %s:\n%s\n" thisfrom err)))))) + (dired-log "Copying error for %s:\n%s\n" thisfrom err))))) + (if (file-directory-p to) + (set-file-modes to mode))) ;; Not a directory. (or top (dired-handle-overwrite to)) (condition-case err