On Fri, 3 Nov 2006 05:24:16 +0100, Allan Odgaard wrote:
On 3. Nov 2006, at 05:09, Une Bévue wrote:
This calls mate as super user, but mate only passes a file name to TextMate, which is still running as your regular user -- so this doesn’t work as you expect.
ok thanks, and using : sudo open -a <absolute_path_2_TextMate> <my_config_file> would open another TextMate ?
No, it would effectively do the same as mate (i.e. sending the filename to TextMate).
There basically is no way you can currently do what you want -- but since ‘sudo mate’ is (by several users) expected to transfer the super user privileges to TextMate (for just that file), I will look into how this could possibly be pulled off sometime in the future (it would be a nice little feature).
One hack would be to use something like my RemoteEdit scripts.
The script would need to: i) make a temporary copy of the file ii) open the file in TextMate for editing iii) On save or close, copy the temporary file back over the original.
hrm. In fact, as my scripts use scp, and that works locally as well as remotely, my remoteEdit script should work just fine for this. :)
http://www.cse.unsw.edu.au/~willu/RemoteEdit/
sudo remoteEdit /my/local/file
should just work... but it doesn't. sigh. It has problems forwarding the ODB suite AppleEvents between root and the normal user. It might not be too hard to work around that though. *wanders off to think*
Cheers,
Will :-}