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

From: Richard Stallman <[email-masked]>
Date: Wed, 09 Jul 2025 22:22:20 -0400

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > 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.

You may be right about that, but directly writing the requested remote
file name will tend to cause various problems, such as the one you're
trying to fix here.

  > 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.

I understand, but other problems can occur -- for instance, if writing
the remote output file fails, that file can be left in a broken state,
or perhaps absent entirely.

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)