Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

ac

Hi Martin, ok thanks anyway.

Kind regards,
Adriano
martin

@ac: Sorry, that's unlikely. It's too big change (and we do not really consider it "bug fix").
ac

Hi Martin,

Is there any chance that the bugfix to this might be backported to 5.x release, please? Unfortunately, it makes it very inconvenient to edit remote server configuration files.

Thanks,
Adriano C.
martin

Thanks for your feedback!
ac

Hi Martin,

I've just tested the private binary and the bug has been fixed.

Many thanks for that!

Kind regards,
Adriano C.
Guest

Hi Martin,

Yes, thanks. I'll test as soon as possible and update you.

Thanks,
Adriano
martin

Did you?
ac

Thank you Martin,

I'll test it as soon as I receive it by email.

Regards,
Adriano
ac

Perfect, thanks.

Regards,
Adriano C.
martin

I see that the behavior is not ideal. I'm going to improve it. I just wanted to make sure I understand the problem. Because your original claims did not match my understanding of what WinSCP is doing.

I'll contact you on your email address, once I have anything to test.
ac

Hi Martin,

I've logged a new session. By forcing the panel refresh, Notepad++ gets correctly notified of the file changes and everything works as expected.

However, I still believe this is a bug because, when I click on Edit, the remote file is technically downloaded locally. In fact, if I manually check the contents into the temporary folder (in my specific case, %Temp%\scp30942\root\winscp.txt), the local file actually contains the latest remote server contents.

But, because the timestamp is preserved, the external editor doesn't reload it. So, from the user perspective, the perceived outcome is that the remote server has not changed.

Thanks,
Adriano
martin

So please post session log of that (edit, refresh, edit).
ac

Hi Martin,

Just tested and I confirm that nothing changes even after a panel refresh (either by pressing F5 or CTRL+R).

Thanks,
Adriano C.
martin

Yes, though the default shortcut in the default Commander interface is Ctrl+R.
ac

Apologies Martin, what do you mean specifically with refreshing the panel? Pressing F5 on the WinSCP windows to force a refresh?

Thanks,
Adriano
martin

I've asked if you refreshed the panel. Not if you cleared a cache.
ac

Good morning Martin,

Not this time, but the first time I faced the problem, having supposed a caching issue, I'm certain I've tried "Commands"/ "Clear Cache" multiple times with no results.

In fact, WinSCP does understand that something is changed remotely and actually transfers the new file locally.

As far as I can tell, the only problem relies on the fact that the timestamp is not updated so the external editors don't refresh the contents/offer to refresh it.

Thanks,
Adriano C.
martin

OK, I assume you did not refresh the file panel between the two edits, right? Would the problem go away, if you do refresh it?
ac

Hi,

Today I downloaded WinSCP 5.21, and I confirm the issue is still present.

I have reasons to believe that the problem is that WinSCP does not update the local timestamp in the temporary folder so it does not allow the external editor (Notepad++ in my case) to realise that the file has changed:

2022-09-21 12:21:58.135 Preserving timestamp [2022-09-21T10:21:53.000Z]


Session debug log and step to reproduce

I've recorded a session inside a log file (attached to this message) where:
- I logged in to a remote Linux server
- Tried Right Click / Edit the "/root/winscp.txt" file previously created. Notepad++ showed the expected contents. The following are the file details on the server:
-rw-r--r-- 1 root root 41 Sep 21 10:21 winscp.txt

- Modified the winscp.txt file on the server. The file size and timestap on the server have changed as expected:
-rw-r--r-- 1 root root 2025 Sep 21 10:23 winscp.txt

- I've added the following log separator to let you easily identify the lines before and after the external modification:
*********************************************************************

**
**** Here the file /root/winscp.txt has been modified on the server!!
**
*********************************************************************

- Tried Right Click / Edit the "/root/winscp.txt" file again. This time Notepad++ has not detected any change.
- Note. The timestamp of the file inside %Temp%/scpXXX/root/winscp.txt has not changed.


As you can imagine, this bug is really troublesome when dealing with a remote server because it's impossible to figure out why something isn't working as expected. The point is that one is not watching the actual file contents!

Thank you in advance for your support,
Adriano C.
martin

Re: Edit does not download modified files but only opens local caches

I cannot reproduce the problem. Please post session log file showing the two "edit" actions. And give us times you triggered both actions.
ac

Edit does not download modified files but only opens local caches

Hi,

I've just noticed that, by trying editing a file on the server (Right Click > Edit), when the file is modified on the server, and one clicks again on Edit, the file is not downloaded anymore, but only the local cache (in the temp folder) is open.

I'm using an external editor (Notepad++) and can confirm that the local temporary file remains unchanged (to exclude a bug of Notepad++). By flushing the cache (or hitting F5), when WinSCP detects a new timestamp on the remote file, by clicking on Edit, the remote file is correctly downloaded and opened.

I've also tried to disable all the caches described here (https://winscp.net/eng/docs/directory_cache), but nothing has changed.

Step to reproduce

  1. Create a remote file
  2. Open it by Right Click > Edit
  3. Modify the remote file
  4. Right Click > Edit
  5. The local file is not downloaded; thus, the external editor does not show the changes.

Expected behaviour
The expected behaviour has WinSCP constantly downloading the remote file on edit, regardless the file is cached locally or not.

Thank you for the support
Adriano C.