Topic "External editor problems"

Author Message
raydavis
[View user's profile]

Joined: 2003-07-27
Posts: 1
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.
Advertisements
jkomorowski

Guest


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.
JustArrived

Guest


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?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
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.
_________________
Martin Prikryl
neggl at web d0t de

Guest


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 Wink

negg.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
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???
_________________
Martin Prikryl
Guest




prikryl 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.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License