<br><br><div class="gmail_quote">2012/9/12 Allan Odgaard <span dir="ltr"><<a href="mailto:mailinglist@textmate.org" target="_blank">mailinglist@textmate.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Sep 11, 2012, at 10:24 AM, Yvon Thoraval <<a href="mailto:yvon.thoraval@gmail.com">yvon.thoraval@gmail.com</a>> wrote:<br>
<br>
> Here it is : […] Save failed! File exists - (bin/menu.zsh, bin/menu.zsh~)<br>
> […]<br>
<div class="im">> Also, i should mention i had a file "bin/menu.zsh~" BEFORE using rmate, then, removing it before a second rmate gave :<br>
</div>> […]<br>
<div class="im">> Then, rmate is working except another file with the suffix "~" exists too.<br>
<br>
</div>I’m a little unclear as to whether or not you solved your problem.<br>
<br>
It might be that File::rename does not unlink destination first. Given that you are using rvm and the script is in ruby, I would assume you can test the relevant code on your version of ruby to see why it has a problem.<br>

<div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div><br></div><div>OK, I've found a solution working even if I want to edit a file of given path where path~ does exist.</div><div><br></div><div>I've just changed the way the hard linked file is name, instead of "#{path}~" i name it npath with, as a starting point i let :</div>
<div>npath="#{path}~"</div><div><br></div><div>and if npath allready exist i change it to :</div><div>npath="#{npath}~"</div><div>              ^_________ notice the "n" here</div><div><br></div>
<div>then I changed the lines 97/104 to :</div><div><div>    npath="#{path}~"</div><div>    if File.exist? path</div><div>      while File.exist? npath</div><div>        npath="#{npath}~"</div><div>      end</div>
<div>      puts "Creating hard link from #{path} to #{npath}." if $settings.verbose</div><div>      File.link(path, npath)</div><div>    end</div></div><div><br></div><div><br></div><div>and here, suppose i do have both files "~/bin/menu.zsh" and "~/bin/menu.zsh~" where I want to remote edit "~/bin/menu.zsh", internally (of rmate-test) the npath would be in this case "~/bin/menu.zsh~~" (with two ~) which doesn't exist.</div>
<div><br></div><div>that makes the rmate-test working :</div><div><div>yt@D620 /home/yt $ rmate-test -v bin/menu.zsh</div><div>yt@D620 /home/yt $ Connect: ‘220 imyt.local RMATE TextMate (Darwin 11.4.0)’</div><div>Saving bin/menu.zsh</div>
<div>Creating hard link from bin/menu.zsh to bin/menu.zsh~~.</div><div>Closed bin/menu.zsh</div><div>Done</div><div><br></div><div>yt@D620 </div></div><div><br></div><div>see attached rmate-test, the modified rmate.</div>
<div><br></div><div> </div></div><br clear="all"><div><br></div>-- <br><div><font face="'comic sans ms', sans-serif" color="#6600cc">Yvon</font></div><div><br></div><br>