From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Artem Chuprina Newsgroups: gmane.emacs.bugs Subject: bug#16133: 24.3; copy-file fails on chmod when copying to FAT filesystem Date: Sat, 14 Dec 2013 14:10:02 +0400 Message-ID: <87ob4jvj45.fsf@wizzle.ran.pp.ru> References: <87vbysv8av.fsf@wizzle.ran.pp.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1387015874 17856 80.91.229.3 (14 Dec 2013 10:11:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 14 Dec 2013 10:11:14 +0000 (UTC) Cc: 16133@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 14 11:11:19 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VrmBr-0004b7-Ai for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 Dec 2013 11:11:19 +0100 Original-Received: from localhost ([::1]:46670 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrmBq-0004Op-S5 for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 Dec 2013 05:11:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrmBh-0004Ll-9O for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2013 05:11:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VrmBb-0002nt-FN for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2013 05:11:09 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35229) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrmBb-0002nn-BX for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2013 05:11:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VrmBb-0005fv-20 for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2013 05:11:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Artem Chuprina Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Dec 2013 10:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16133 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16133-submit@debbugs.gnu.org id=B16133.138701581521727 (code B ref 16133); Sat, 14 Dec 2013 10:11:02 +0000 Original-Received: (at 16133) by debbugs.gnu.org; 14 Dec 2013 10:10:15 +0000 Original-Received: from localhost ([127.0.0.1]:49244 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VrmAo-0005eL-Vw for submit@debbugs.gnu.org; Sat, 14 Dec 2013 05:10:15 -0500 Original-Received: from minas.ran.pp.ru ([178.63.209.8]:50915) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VrmAl-0005eB-LD for 16133@debbugs.gnu.org; Sat, 14 Dec 2013 05:10:13 -0500 Original-Received: from [188.32.7.67] (helo=wizzle.ran.pp.ru) by minas.ran.pp.ru with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1VrmAk-0006jM-B6; Sat, 14 Dec 2013 10:10:10 +0000 Original-Received: from ran by wizzle.ran.pp.ru with local (Exim 4.80) (envelope-from ) id 1VrmAc-00066M-Ey; Sat, 14 Dec 2013 14:10:02 +0400 In-Reply-To: (Glenn Morris's message of "Fri, 13 Dec 2013 17:51:34 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:81936 Archived-At: Glenn Morris -> Artem Chuprina @ Fri, 13 Dec 2013 17:51:34 -0500: >> Having org on ext4 filesystem with 0664 permission on org/work.org, and >> c1 on FAT filesystem with file permissions 0075 (in fact, SD card on >> Android system, so such strange permissions) I do >> >> M-: copy-file("org/work.org" "c1/work.org" t) >> >> and get an error >> >> Debugger entered--Lisp error: (file-error "Doing chmod" "operation not >> permitted" $ GM> I'm not sure this is a bug. GM> The file is copied, but there is an error trying to preserve permissions. GM> Because eval-expression-debug-on-error is non-nil by default, the GM> debugger pops up. GM> Emacs's behaviour seems the same as using GM> cp -a org/work.org c1/work.org GM> on the command-line. "-a" is appropriate because C-h f copy-file says: GM> This function always sets the file modes of the output file to match GM> the input file. The problem is that now it is impossible to use other functions that use copy-file. I've encountered this bug trying to use org-mobile-push that, among other, copies several files to its target directory (which I want to be on FAT partition for Android's MobileOrg). On the first such file, copy-file throws an error, and whole operation stops there and so fails. org-mobile-push catches error and don't enter a debugger, but it don't work either, thinking that it failed to copy file. Yet file is indeed copied, just (totally unneeded in this case) chmod failed. I think that it is a good idea to _attempt to_ copy permissions. But it is a bad idea to throw an error if file is copied well but we cannot set permissions. These days it is very common to copy files between incompatible file systems. Most of us use FAT, many use CIFS, there are also NFS, davfs, sshfs etc. So I think that a reasonable behavior would be to try to set permissions, but don't fail on chmod error. At least, on copy-file level (if chmod function itself throws an error, this is ok, but copy-file should not).