synchronizationprocmon

7z file manager deletes temporary file for external editor


I am using a lot applications from portableapps.com for work, and more particularly 7-zip portable and gVim portable.

I have set 7zip's external editor to gVimPortable.exe. It works perfectly when editing a file that is not inside an archive or compressed file… but it miserably fails when editing a file inside an archive or compressed file.

What happens is that 7-zip portable stores the file to a temporary place, launches gvimportable.exe, which forks and opens gvim.exe.

And some time after gvimportable.exe exits, I can see in Procmon that 7zFM.exe does a “SetDispositionInformationFile” (Details: “Delete: True”) that deletes the temporary file, and when gvim tries to open it, the file has been deleted.

Note that it works perfectly if I set the editor to NotepadPlusPlusportable.exe.

Do you have an explanation for this behaviour?

Please not that the -f option of gVimPortable.exe does not solve my problem.


Solution

  • When gvim started as you say by default it forks and exits so 7z thinks that the edit has finished and deletes the file.

    What you need is to pass the argument -f or --nofork to prevent this.

    See the startup section in the gvim manual

    rev1

    add

    let &guioptions = "gmrLtTf"
    

    to _vimrc (Edit->Startup Settings)