[TxMt] Re: Permissions problem with CLI mate...

Allan Odgaard mailinglist at textmate.org
Thu Apr 23 20:01:31 UTC 2009


On 23 Apr 2009, at 00:01, Andrew Farley wrote:

> [...] Even if I "sudo mate".  Textmate pretends it opened this file  
> but the file is empty, and when you save it it will ask for  
> administrative privileges to do so.

TextMate only supports saving as root, not opening files as root.

The ‘mate’ shell command is a simple helper app which effectively  
does: “open -a TextMate «file»” resulting in TextMate receiving an  
“open this file” message, so running the messanger (mate) as root  
(sudo) does not help (as TextMate is already running as your current  
user, and it shouldn’t be attempted to run TextMate as root, as many  
things rely on $HOME/Library/… plus all the frameworks pulled in).

I am however aware of the desire to use ‘sudo mate’ and have some  
proof-of-concept code that works, although it’s not ideal, but I do  
expect these things to be fully addressed in the future.

> [...] Anyone have a workaround for this, or any ideas?

Unless you have very good reason not to make the files readable by  
your normal user, I’d say you should simply make them readable by your  
current user. You can still make them only root-writable, as TM will  
handle that.

Alternatively you can do a wrapper for mate that handles these things  
(i.e. letting TM edit a temporary file, either using “mate -w” or via  
pipes).




More information about the textmate mailing list