The check box <by content> in <Synchronize directories> does the opposite in my WFX plugin
Moderators: Hacker, petermad, Stefan2, white
The check box <by content> in <Synchronize directories> does the opposite in my WFX plugin
Hello.
I wrote a WFX plugin for cloud internet disk support - for my own needs.
But in <Synchronize directories> the check box <by content> work does the opposite.
When check box <by content> is checked, synchronization does not download the internal content of files and does not compare them.
When check box <by content> is unchecked, synchronization download the internal content of files and compare them.
Did I miss anything while writing the plugin in any function?
I was based on the source code of this plugin in Deplhi: HTTP browser 1.0.4 https://plugins.ghisler.com/fsplugins/hbrowser_source.zip
I wrote a WFX plugin for cloud internet disk support - for my own needs.
But in <Synchronize directories> the check box <by content> work does the opposite.
When check box <by content> is checked, synchronization does not download the internal content of files and does not compare them.
When check box <by content> is unchecked, synchronization download the internal content of files and compare them.
Did I miss anything while writing the plugin in any function?
I was based on the source code of this plugin in Deplhi: HTTP browser 1.0.4 https://plugins.ghisler.com/fsplugins/hbrowser_source.zip
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: The check box <by content> in <Synchronize directories> does the opposite in my WFX plugin
This makes no sense - file system plugins don't support compare by content, and files don't get downloaded.
There is an inofficial not yet documented set of functions which can ask the file system plugin for a checksum - many cloud services report a cecksum.
My SFTP plugin supports this method, you can check the sources.
Have a look at sftpplug.cpp, the functions:
int __stdcall FsServerSupportsChecksumsW(WCHAR* RemoteName)
int __stdcall FsServerSupportsChecksums(char* RemoteName)
HANDLE __stdcall FsStartFileChecksumW(int ChecksumType,WCHAR* RemoteName)
HANDLE __stdcall FsStartFileChecksum(int ChecksumType,char* RemoteName)
int __stdcall FsGetFileChecksumResultW(BOOL WantResult,HANDLE ChecksumHandle,WCHAR* RemoteName,char* checksum,int maxlen)
int __stdcall FsGetFileChecksumResult(BOOL WantResult,HANDLE ChecksumHandle,char* RemoteName, char* checksum,int maxlen)
Christian Ghisler
There is an inofficial not yet documented set of functions which can ask the file system plugin for a checksum - many cloud services report a cecksum.
My SFTP plugin supports this method, you can check the sources.
Have a look at sftpplug.cpp, the functions:
int __stdcall FsServerSupportsChecksumsW(WCHAR* RemoteName)
int __stdcall FsServerSupportsChecksums(char* RemoteName)
HANDLE __stdcall FsStartFileChecksumW(int ChecksumType,WCHAR* RemoteName)
HANDLE __stdcall FsStartFileChecksum(int ChecksumType,char* RemoteName)
int __stdcall FsGetFileChecksumResultW(BOOL WantResult,HANDLE ChecksumHandle,WCHAR* RemoteName,char* checksum,int maxlen)
int __stdcall FsGetFileChecksumResult(BOOL WantResult,HANDLE ChecksumHandle,char* RemoteName, char* checksum,int maxlen)
Christian Ghisler
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: The check box <by content> in <Synchronize directories> does the opposite in my WFX plugin
Hi ghisler,
Starting which version TC supports this inofficial set of functions?
Starting which version TC supports this inofficial set of functions?
Re: The check box <by content> in <Synchronize directories> does the opposite in my WFX plugin
Searching through totalcmd*.exe files of the last half dozen of releases shows version 9.10 is the first to have these functions.megaboy2k wrote: 2021-10-25, 00:26 UTCStarting which version TC supports this inofficial set of functions?
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
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: The check box <by content> in <Synchronize directories> does the opposite in my WFX plugin
Thanks Dalai,
Just checked TC10 with SFTP plugin 2.80 and now <Synchronize directories> compares files by content as expected!
Just checked TC10 with SFTP plugin 2.80 and now <Synchronize directories> compares files by content as expected!
Re: The check box <by content> in <Synchronize directories> does the opposite in my WFX plugin
One more observation.
File comparision with <Synchronize directories> works correctly only if line endings on both sides are identical.
This can be achived by setting Binary transfer mode for even text files, e.g. source code cpp, h, etc.
Otherwise it will apply coversion based on plugin setting. Moreover, this conversion has pretty unlear logic. If it is set to Unix system then
the plugin will convert line endings to Windows style. If it is set to Windows system it stops converting it at all (LF and CR/LF are both accesible).
I am actually in doubt wich way is more accurate, is it using binary mode always or to set Windows system in plugin settings.
File comparision with <Synchronize directories> works correctly only if line endings on both sides are identical.
This can be achived by setting Binary transfer mode for even text files, e.g. source code cpp, h, etc.
Otherwise it will apply coversion based on plugin setting. Moreover, this conversion has pretty unlear logic. If it is set to Unix system then
the plugin will convert line endings to Windows style. If it is set to Windows system it stops converting it at all (LF and CR/LF are both accesible).
I am actually in doubt wich way is more accurate, is it using binary mode always or to set Windows system in plugin settings.
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: The check box <by content> in <Synchronize directories> does the opposite in my WFX plugin
If you set the mode to Windows system, it's assumed that the remote system is a Windows device, and the local too. Therefore no conversion is needed. If you set it to Unix, then a conversion is needed both on upload and download.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com