[WFX] Synchronize directories doesn't handle changed filenames

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Dalai
Power Member
Power Member
Posts: 9387
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

[WFX] Synchronize directories doesn't handle changed filenames

Post by *Dalai »

Hi there :).

The title is somewhat generic, but I couldn't think of a better one without making it too long.

To reproduce this you need a WFX plugin that is able to change filenames when a remote file is shown in Lister (F3), e.g. any of my plugins (with AddTxtExtensionOnDownload=1 set in their INI).
  1. In the left panel switch to the WFX plugin and select any file (doesn't matter how many).
  2. In the right panel switch to some local directory (empty dir is recommended).
  3. Call Synchronize directories (cm_FileSync) and start the comparison.
  4. Press F3 on any file on the left-hand side.
  5. You'll get an error message from TC, similar to this one:

    Code: Select all

    ---------------------------
    File not found!
    ---------------------------
    TCP/IP NetBIOS Helper.Running
    ---------------------------
    OK   
    ---------------------------
The error message is technically correct since the plugin saved the data to a different file. The error doesn't occur when the same file is shown in Lister outside of TC's Synchronize directories. The error also doesn't occur when the plugin doesn't change the local filename.

Sure, Synchronize directories also compares filenames. The problem is that the plugin doesn't know (and doesn't need to know) which TC feature requested the file, and they all call the same plugin function FsGetFile(W).

So the question is: Why doesn't TC use the changed filename from FsGetFile(W) function when called from within Synchronize directories?

BTW: This issue is a long-standing one; it's reproducible even in TC 8.01.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: [WFX] Synchronize directories doesn't handle changed filenames

Post by *Usher »

Just a formal question: Why doesn't your plugin create/use names which are valid Windows filenames? It seems to be an obvious requirement for file system plugins.
Andrzej P. Wozniak
Polish subforum moderator
User avatar
Dalai
Power Member
Power Member
Posts: 9387
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: [WFX] Synchronize directories doesn't handle changed filenames

Post by *Dalai »

OK, so let's get this straight. Here's what happens, and I'm using the example filename from above: TC calls FsGetFile and provides a local filename "TCP_IP NetBIOS Helper.Running". The plugin is allowed to change the filename in FsGetFile, which my plugins do, in this example the name is changed to "TCP_IP NetBIOS Helper.Running.txt" (just .txt extension added). This works just fine in regular Lister, but not in Synchronize directories - that's where the bug is.

So, your question is not relevant, because the filename in the example is already valid when TC passes it to the plugin. And even if the filenames would contain quotes or other invalid characters, they're replaced on the plugin side in FsGetFile. So, no, my plugins don't try to save to files with invalid names (although they did in the past because I thought TC would already take care of it).

But you made me aware of another bug in conjunction with the one above: TC shows a different filename in the error message than it provides to the plugin.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: [WFX] Synchronize directories doesn't handle changed filenames

Post by *Usher »

Dalai wrote: 2019-04-26, 00:54 UTC But you made me aware of another bug in conjunction with the one above: TC shows a different filename in the error message than it provides to the plugin.
Yeah, that's strange. Either it's some hack/workaround in TC or there are calls for more functions used in TC for WFX support, and some of them possibly need to be updated/replaced. Just guessing.
Andrzej P. Wozniak
Polish subforum moderator
Post Reply