使用Notepad++遠程編輯WinSCP中打開的文本文件報錯“file xxx does exist anymore”


我原來經常使用notepad++與WinSCP的配合,快速對遠程Linux主機上的配置文件進行修改並保存。

最近在我的一台機器上,這個辦法居然不靈了,有的時候可以,有的時候就報錯:file does exist anymore. 如果keep in editor, 那也就無法保存到遠程主機上了。

image


經過一番搜索,找到了參考資料部分記錄的那篇文章。


因為當初亂點了個選項:

image


導致了這個問題,去掉就好了。


問題的解釋如下:

You have the "External editor opens each file in separate window (process)" editor preference option enabled. That's what causing the problem.

The option is by default unchecked and should be checked only when you use an editor that opens each file in a separate process. That is not the case of Notepad++: When you open the file for editing in WinSCP and the Notepad++ is already running, the new Notepad++ instance just delegates the opening to the existing instance and exits. As you have the above option on, WinSCP detects the exit and considers the file to be closed (deleting it).

For details, see WinSCP documentation for Opening more files in a single editor instance.


大致意思是說,這個選項導致了這個問題,因為選項的意思是每次都使用一個新的編輯器的實例(instance)來編輯文件,而notepad++是會代理到已經打開的instance上再開一個tab,而這個代理的過程WinSCP不認,於是就報文件不存在了。

去掉這個選項,問題就解決了。


參考資料

============

WinSCP and Notepad++: File does not exist anymore?

https://superuser.com/questions/989538/winscp-and-notepad-file-does-not-exist-anymore


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM