I launch dired over Tramp (from Win machine to Linux server):

C-x d /plink:user@server|su:root@server:/path-to-folder-controlled-by-root/

Then I type "O" to chown a folder, but I get chown not supported on this system. Debugging, I can see the error stems from the definition of dired-of-chgrp, which makes the following verification :

  (if (memq system-type '(ms-dos windows-nt))
      (error "chgrp not supported on this system"))

which obviously fails, because my machine is Windows — but I'm not chowning on Windows. Removing these two lines allows me to use the function normally. I have the same issue with chgroup.

Does this mean my setup is incorrect, or is this a limitation? What would be a clean way to correct this? Just removing these two lines seems like a dirty hack.

  • 1
    M-x report-emacs-bug – phils Jul 8 '19 at 10:22

The proper fix would be

(if (and (memq system-type '(ms-dos windows-nt))
         (not (file-remote-p default-directory)))
    (error "chgrp not supported on this system"))

I've fixed this in the Emacs repository, will appear with Emacs 27.1.

  • Nice, thank you! I see that your code does not test if the distant system is Windows or not, is that because that type of verification is rare / difficult to make / useless ? – kotchwane Jul 8 '19 at 12:15
  • 1
    When you are on an MS Windows machine, Tramp does not give you access to another Windows machine. – Michael Albinus Jul 8 '19 at 12:26
  • I'm using Emacs-25.3 and need to apply this fix. In which file, is it applied? – Terry Oct 18 '19 at 15:13
  • You can see the patch at <git.savannah.gnu.org/cgit/emacs.git/commit/…> – Michael Albinus Oct 19 '19 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.