Someone had asked the other day about editing files as root. I notice that TextMate prompts for an admin username/password when asked to save a file to which it does not have access, but that doesn't do much good if the file can't be read in the first place. (BTW, shouldn't TextMate/mate warn if you pass it the name of an inaccessible file?)
Anyway, I whipped up the attached script which I call smate. FWIW, I guess this functionality could be built into mate itself. (Allan, wasn't the source for mate available at some point?)
HTH,
j.
Le 8 nov. 06 à 07:07, Jay Soffian a écrit :
Someone had asked the other day about editing files as root.
me ;-)
it works fine see :
-rw-r--r-- 1 news admin 196 Nov 4 04:48 essai-sudo-config ---------------- ^^^^^^^^^^^^----------------------------------------------------
/Applications/TextMate/sudo_textmate%> sudo ./smate ./essai-sudo-config Replace original? (Yes/No/Diff) [y/n/d]: y ^^^^^^^^^^^^^^^^--------------------------------- very much appreciated !!!
-rw-r--r-- 1 news admin 211 Nov 8 10:01 essai-sudo-config ---------------- ^^^^^^^^^^^^----------------------------------------------------
i'll put it in my ~/bin now.
thanks a lot !!!
Yvon