External editor problems

Advertisement

raydavis
Joined:
Posts:
1

External editor problems

It looks like there may be a race condition in the "Edit" code for external editors. When I try to edit a remote file, in either the Explorer or Commander interfaces, it looks like WinSCP creates a temporary directory, downloads the file to it, executes the external editor command line, and then immediately tries to delete the downloaded file and temporary directory.

Sometimes the external editor manages to read the file before WinSCP deletes it (although then there's no copy on disk); sometimes the editor doesn't get there in time and ends up opening a new document with that filename. In either case, since the editor has a file open in that temporary directory, WinSCP puts up an error alert about not being able to delete the temporary directory.

WinSCP doesn't notice when the file from the editor has been saved.

Current setup: WinSCP 3.1.0, build 165. Windows 2000. Using TextPad as an external editor.

Reply with quote

Advertisement

jkomorowski
Guest

Re: External editor problems

SAme problems are with UltraEdit + WinXP

raydavis wrote:

It looks like there may be a race condition in the "Edit" code for external editors. When I try to edit a remote file, in either the Explorer or Commander interfaces, it looks like WinSCP creates a temporary directory, downloads the file to it, executes the external editor command line, and then immediately tries to delete the downloaded file and temporary directory.

Sometimes the external editor manages to read the file before WinSCP deletes it (although then there's no copy on disk); sometimes the editor doesn't get there in time and ends up opening a new document with that filename. In either case, since the editor has a file open in that temporary directory, WinSCP puts up an error alert about not being able to delete the temporary directory.

WinSCP doesn't notice when the file from the editor has been saved.

Current setup: WinSCP 3.1.0, build 165. Windows 2000. Using TextPad as an external editor.

Reply with quote

JustArrived
Guest

Also suffering premature deletion with UltraEdit

The file gets copied to a temporary location, and UltraEdit opens it.
But by the time you come to save the file, the original has been deleted, so UltraEdit throws up a "Save as" dialog. If you try to use the original name, it turns out that the directory has also been deleted.
End result - WinSCP never gets to know that you've performed an edit.

Why does the file and dir get deleted when using UE, but not when using Notepad?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Also suffering premature deletion with UltraEdit

JustArrived wrote:

Why does the file and dir get deleted when using UE, but not when using Notepad?
WinSCP runs the editor process and waits until it is terminated. Some editors, when opening file, only run another process (or send the file to existing editor instance) and terminates immediatelly. WinSCP cannot recognise this. I'll try to solve it.

Reply with quote

neggl at web d0t de
Guest

Re: Also suffering premature deletion with UltraEdit

I managed to use a, well, kind of, workaround: you need to make sure that Ultraedit is not running at all when editing a file from winscp. After editing close Ultraedit completely.

Not suitable under all working conditions I must admit ;-)

negg.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Also suffering premature deletion with UltraEdit

neggl at web d0t de wrote:

I managed to use a, well, kind of, workaround: you need to make sure that Ultraedit is not running at all when editing a file from winscp. After editing close Ultraedit completely.
Yes, this corresponds to my previous post. If one instance of Ultraedit is already running and WinSCP opens file to edit, the second instance of Ultraedit is launched (it is invisible) and it only sends message to the first to open the file and closes. WinSCP thinks that the file is closed too, but it is opened by first instance, which WinSCP does not know about.
Maybe Ultraedit has some option to open each file in its own program instance???

Reply with quote

Guest

Re: Also suffering premature deletion with UltraEdit

martin wrote:

Maybe Ultraedit has some option to open each file in its own program instance???

In textpad you can allow multiple instances to run. This seemed to fix the cannot delete temp issue.

Reply with quote

Advertisement

You can post new topics in this forum