Hi:
I am using Textmate to edit scripts on a remote server. I use FTP (client is Transmit) to get to them, then open them from Transmit it Textmate.
I noticed something odd recently: With each series of edits to the script file, after I saved, I went to run the script and the execute permission was gone (I edited the file, did chmod u+x, ran the script, then went to edit again, etc. when I saved, I had to chmod u+x again because the execute was lost).
The only reason (other than server bugs) that I can find that this my have happened is that I opened the file with Textmate originally before I did chmod u+x (right after I did touch to create it), and that the permissions on the file that Textmate opened were -rw-r--r-- so I restored those when it saved.
Two questions:
1) Is this possible? Does Textmate do this?
2) If yes, how can I get it not to change permissions back on save?
Any help, direction or advice is much appreciated!
Thanks,
Jeff
On 9 Jul 2013, at 2:31, Jeff Weinberger wrote:
[…] after I saved […] the execute permission was gone […]
- Is this possible? Does Textmate do this?
No, TextMate will preserve the original file’s metadata.
It will do an automatic ‘chmod a+x’ for certain file types (with shebang), via a bundle item, but that is the opposite of your issue.
That said, if you open the file in Transmit then Transmit will download it to a temporary and open that temporary file in TextMate. When TextMate saves, Transmit will upload the file, so the issue is more likely with Transmit not preserving the server’s file meta data.
I assume you did “touch” and “chmod u+x” on the server (via ssh or similar).
On Tue, Jul 9, 2013 at 2:00 AM, Allan Odgaard mailinglist@textmate.orgwrote:
On 9 Jul 2013, at 2:31, Jeff Weinberger wrote:
[…] after I saved […] the execute permission was gone […]
- Is this possible? Does Textmate do this?
No, TextMate will preserve the original file’s metadata.
It will do an automatic ‘chmod a+x’ for certain file types (with shebang), via a bundle item, but that is the opposite of your issue.
That said, if you open the file in Transmit then Transmit will download it to a temporary and open that temporary file in TextMate. When TextMate saves, Transmit will upload the file, so the issue is more likely with Transmit not preserving the server’s file meta data.
I assume you did “touch” and “chmod u+x” on the server (via ssh or similar).
First, thank you! This makes perfect sense. I will check to see if Transmit might be causing this.
I wonder, though, when you say that TextMate preserves the original file's metadata, if that isn't the cause. Here's why I wonder:
The sequence of events is this:
- SSH to server with a terminal window - touch filename - open filename with TextMate via Transmit - edit file - save file (but keep it open in TextMate) - chmod u+x filename - ./filename - edit in TextMate - Save from TextMate (and keep open) ----> 'x' permission is gone
If TextMate re-writes the file with the metadata from the time it was originally opened, then that would cause the issue. If it writes the file without changing the then-current metadata (which have changed since it was opened) then the issue is likely Transmit.
What do you think?
Thank you so much for your help and advice on this!
On 9 Jul 2013, at 16:45, Jeff Weinberger wrote:
[…] If TextMate re-writes the file with the metadata from the time it was originally opened, then that would cause the issue. If it writes the file without changing the then-current metadata (which have changed since it was opened) then the issue is likely Transmit.
TextMate works on a temporary file that Transmit created and knows nothing about the file on your server.
If you change the file on the server while it is open in TextMate, then it would fall upon Transmit to sync the changes when TextMate saves and triggers Transmit to upload the (temporary) file.
Are you btw aware of rmate? If you work a lot over ssh, then rmate is a great asset, and when rmate accepts changes from TextMate, it will preserve metadata :)
Caveat: rmate now requires permission to install python gems on the target server, instead of the previously minimally invasive script that could be simply plopped into ~/bin
This has drastically curtailed my ability to use rmate remotely.
-- Jason
On Jul 9, 2013, at 13:18, "Allan Odgaard" mailinglist@textmate.org wrote:
On 9 Jul 2013, at 16:45, Jeff Weinberger wrote:
[…] If TextMate re-writes the file with the metadata from the time it was originally opened, then that would cause the issue. If it writes the file without changing the then-current metadata (which have changed since it was opened) then the issue is likely Transmit.
TextMate works on a temporary file that Transmit created and knows nothing about the file on your server.
If you change the file on the server while it is open in TextMate, then it would fall upon Transmit to sync the changes when TextMate saves and triggers Transmit to upload the (temporary) file.
Are you btw aware of rmate? If you work a lot over ssh, then rmate is a great asset, and when rmate accepts changes from TextMate, it will preserve metadata :)
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Thank you and thank you!
So it sounds like it's not any one of the products I'm using, but the way they interact. TextMate opens a local copy that Transmit creates, and, it seems that when I save in TextMate, TextMate sends the metadata, and Transmit respects that and saves it to the server. But since I've changed the permissions in the interim, my changes on the server (outside TextMate and Transmit) are being lost as a result.
I will have to change the way I work with that, so that I change permissions first and then open it in TextMate via Transmit in the future.
I'll also look into rmate, but not sure that will work for me either...
Thanks!
On Tue, Jul 9, 2013 at 1:33 PM, Jason Smith jason@ncpod.org wrote:
Caveat: rmate now requires permission to install python gems on the target server, instead of the previously minimally invasive script that could be simply plopped into ~/bin
This has drastically curtailed my ability to use rmate remotely.
-- Jason
On Jul 9, 2013, at 13:18, "Allan Odgaard" mailinglist@textmate.org wrote:
On 9 Jul 2013, at 16:45, Jeff Weinberger wrote:
[…] If TextMate re-writes the file with the metadata from the time it
was
originally opened, then that would cause the issue. If it writes the
file
without changing the then-current metadata (which have changed since it
was
opened) then the issue is likely Transmit.
TextMate works on a temporary file that Transmit created and knows
nothing about the file on your server.
If you change the file on the server while it is open in TextMate, then
it would fall upon Transmit to sync the changes when TextMate saves and triggers Transmit to upload the (temporary) file.
Are you btw aware of rmate? If you work a lot over ssh, then rmate is a
great asset, and when rmate accepts changes from TextMate, it will preserve metadata :)
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Thanks a lot for suggestions
Liz
On 9 Jul 2013, at 22:16, Jeff Weinberger wrote:
Thank you and thank you!
So it sounds like it's not any one of the products I'm using, but the way they interact. TextMate opens a local copy that Transmit creates, and, it seems that when I save in TextMate, TextMate sends the metadata, and Transmit respects that and saves it to the server. But since I've changed the permissions in the interim, my changes on the server (outside TextMate and Transmit) are being lost as a result.
I will have to change the way I work with that, so that I change permissions first and then open it in TextMate via Transmit in the future.
I'll also look into rmate, but not sure that will work for me either...
Thanks!
On Tue, Jul 9, 2013 at 1:33 PM, Jason Smith jason@ncpod.org wrote: Caveat: rmate now requires permission to install python gems on the target server, instead of the previously minimally invasive script that could be simply plopped into ~/bin
This has drastically curtailed my ability to use rmate remotely.
-- Jason
On Jul 9, 2013, at 13:18, "Allan Odgaard" mailinglist@textmate.org wrote:
On 9 Jul 2013, at 16:45, Jeff Weinberger wrote:
[…] If TextMate re-writes the file with the metadata from the time it was originally opened, then that would cause the issue. If it writes the file without changing the then-current metadata (which have changed since it was opened) then the issue is likely Transmit.
TextMate works on a temporary file that Transmit created and knows nothing about the file on your server.
If you change the file on the server while it is open in TextMate, then it would fall upon Transmit to sync the changes when TextMate saves and triggers Transmit to upload the (temporary) file.
Are you btw aware of rmate? If you work a lot over ssh, then rmate is a great asset, and when rmate accepts changes from TextMate, it will preserve metadata :)
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate