From: Artem Chuprina <ran@lasgalen.net>
To: Glenn Morris <rgm@gnu.org>
Cc: 16133@debbugs.gnu.org
Subject: bug#16133: 24.3; copy-file fails on chmod when copying to FAT filesystem
Date: Sat, 14 Dec 2013 14:10:02 +0400 [thread overview]
Message-ID: <87ob4jvj45.fsf@wizzle.ran.pp.ru> (raw)
In-Reply-To: <p9zjo4mkjt.fsf@fencepost.gnu.org> (Glenn Morris's message of "Fri, 13 Dec 2013 17:51:34 -0500")
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).
next prev parent reply other threads:[~2013-12-14 10:10 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-13 19:51 bug#16133: 24.3; copy-file fails on chmod when copying to FAT filesystem Artem Chuprina
2013-12-13 22:51 ` Glenn Morris
2013-12-13 22:55 ` Glenn Morris
2013-12-14 10:10 ` Artem Chuprina [this message]
2013-12-14 20:19 ` Glenn Morris
2013-12-14 20:46 ` Josh
2013-12-14 20:57 ` Eli Zaretskii
2013-12-14 21:21 ` Josh
2013-12-15 3:44 ` Eli Zaretskii
2013-12-14 20:55 ` Eli Zaretskii
2013-12-14 21:07 ` Achim Gratz
2013-12-15 14:38 ` Artem Chuprina
2013-12-16 14:15 ` Stefan Monnier
2013-12-20 23:27 ` Paul Eggert
2013-12-22 0:01 ` Paul Eggert
2013-12-22 3:47 ` Eli Zaretskii
2013-12-22 4:01 ` Paul Eggert
2013-12-22 15:50 ` Artem Chuprina
2013-12-22 19:03 ` Paul Eggert
2013-12-22 20:13 ` Artem Chuprina
2013-12-23 23:58 ` Paul Eggert
2013-12-24 6:52 ` Artem Chuprina
2013-12-24 9:58 ` Andreas Schwab
2013-12-24 10:22 ` Artem Chuprina
2013-12-24 17:39 ` Paul Eggert
2013-12-24 16:51 ` Artem Chuprina
2013-12-29 18:31 ` Paul Eggert
2013-12-22 16:24 ` Eli Zaretskii
2013-12-22 17:37 ` Paul Eggert
2013-12-22 18:35 ` Eli Zaretskii
2013-12-22 18:54 ` Paul Eggert
2013-12-22 20:32 ` Artem Chuprina
2013-12-22 21:00 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ob4jvj45.fsf@wizzle.ran.pp.ru \
--to=ran@lasgalen.net \
--cc=16133@debbugs.gnu.org \
--cc=rgm@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).