Home Download Buy Blog Forum Support

Problems with 7-zip integration as editor

Problems with 7-zip integration as editor

Postby GreyWyvern on Wed Feb 03, 2010 9:38 pm

One of things I used to do often with my old text editor was edit text files within zip archives while having them open in the 7-zip program. 7-zip allows editing files within archives by creating a temporary folder in C:\Documents and Settings\%USER%\Local Settings\Temp, copying the file there and then checking on it to see whether or not it gets modified. If so, the next time 7-zip is focused, it asks you if you'd like to refresh that particular file in the archive you have open.

For some reason, this doesn't work in Sublime Text. When I set my editor to be ST, the folder gets created in the Temp directory, and ST opens the correct file for editing (the path and filename are in the title bar), however when you look in the created folder it is empty. It's as if 7-zip did everything correctly, then immediately deleted the temp file as soon as Sublime Text opened it. If you then save the file using ST, the file is created, but by this time 7-zip has stopped watching because it never asks you if you would like to refresh the file in the archive. This effectively breaks the edit-within-archive ability.

I tested this 7-zip file edit system using Metapad, Wordpad, and OpenOffice SWriter, and the only program for which the behaviour was broken was Sublime Text. Even knowing that, though, I'm not exactly sure what is going on here. Is there some sort of action ST performs on a file while opening that would make 7-zip just delete it?
GreyWyvern
 
Posts: 106
Joined: Fri Oct 23, 2009 7:08 pm
Location: Canadia

Re: Problems with 7-zip integration as editor

Postby jps on Wed Feb 03, 2010 9:42 pm

This is likely because Sublime Text is already running, so the instance that is spawned by 7-zip will simply hand the command line arguments over to the existing process and exit (see also viewtopic.php?f=3&t=990). I assume 7-zip is simply deleting the temporary file as soon as the process it spawned exits.

WinSCP has a setting to integrate with editors that work this way (it's fairly common) - the "External editor opens multiple files in one window" option.
jps
Site Admin
 
Posts: 3069
Joined: Wed Mar 19, 2008 12:33 pm


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 12 guests