GNU bug report logs - #78638
30.1; When editing a remote file owned by another user, Tramp signals an error because it cannot change the file mode

Previous Next

Package: emacs;

Reported by: Michael McClennen <mmcclenn <at> geology.wisc.edu>

Date: Thu, 29 May 2025 21:10:02 UTC

Severity: normal

Found in version 30.1

Full log


Message #98 received at 78638 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Richard Stallman <rms <at> gnu.org>
Cc: mmcclenn <at> geology.wisc.edu, 78638 <at> debbugs.gnu.org
Subject: Re: bug#78638: 30.1; When editing a remote file owned by another
 user, Tramp signals an error because it cannot change the file mode
Date: Tue, 08 Jul 2025 09:31:07 +0200
Richard Stallman <rms <at> gnu.org> writes:

Hi Richard,

>   > > When Emacs saves a file directly, its preferred method is to write the
>   > > file under another name and then ewnames it into the desired name.
>   > > That is to avoid problems like this.
>
>   > This is what Tramp does. It writes the file to a local temporary name,
>   > and copies it then to the remote side.
>
> Those two methods are different in a crucial way.  Whan Emacs usually
> does is _rename_ the temporary file, which it has written in the
> destination directory, to the desired name.  It sounds like Tramp
> writes a temporary file in the local machine, then _copies_ the
> temporary file to the desired name in the destination directory.
>
> Is it possible for Tramp to write the output into a remote file
> in the intended remote directory, then rename it to the intended
> file name?

Tramp writes a local temporary file for a reason: In general, Emacs
cannot write a file to the remote host directly. It needs external help
(like scp and alike) to transfer a local file to the remote side.

Tramp could write a local temporary file, transfer it to a remote
temporary file, and rename the remote temporary file to the intended
file name. But this would require an additional step, which will be not
acceptable for performance reasons.

Note, that the root case of this bug was Tramp calling chmod, not the
copying action itself. Annoying, but not the end of the word.

Best regards, Michael.




This bug report was last modified 31 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.