Page 1 of 1

Replace Characters not working

Posted: Mon Apr 25, 2022 4:07 pm
by Systeq
I'm trying to upload from an sftp site to OneDrive. The sftp site allows almost all characters, so we have various files and folders with | ? etc in the name, which obviously aren't allowed by OneDrive. If I attempt to sync then obviously it fails on those files and folders.

To resolve the issue I've attempted to use the Replace characters setting in the Advanced Internet settings, however this doesn't appear to work. I have a rule to replace | with -, but what I now see is: TGPuttySFTPException DownloadStreamP: Error 2, no such file or directory.

The file name given in the error is the correct source path, with | in the name, and I've confirmed it does exist.

Re: Replace Characters not working

Posted: Mon Apr 25, 2022 4:20 pm
by tobias
Hello,
it might be worth a try to use the Replace Characters feature on the other side (right versus left).

Or use the PascalScript "Convert Disallowed Characters for Windows" to replace disallowed characters instead:
https://www.syncovery.com/pascalscript/

https://www.syncovery.com/convertdisall ... acters.txt

In general, it is not recommended to replace | with a simple character like -, because not all - on the destination are | on the source. So in such cases, filename comparison is not well defined and can only be done in one direction. Well if you copy only in one direction, it might be OK. For two-way syncs, you need to find unique characters like the ones from the script.

If problems remain, please send a log file to support@syncovery.com.

Re: Replace Characters not working

Posted: Mon Apr 25, 2022 5:00 pm
by Systeq
Thank you for the quick reply.

The sync will only ever be one way in this case, so a single character shouldn't be an issue.

I originally tried setting the rule on the right, which didn't work either. However something I'm confused by is that populating the rules on one side also populates the rules for the other side exactly the same, so it's not easy to understand how and where this rule is actually applying.

I've just tried the pascal script and it definitely works better. It's skipped a small number of files, which seem to be complaining that the file already exists. As it's only a handful of files I should be able to sort these out, even if it means renaming them on the left manually,

Thanks for your help.

Re: Replace Characters not working

Posted: Mon Apr 25, 2022 5:47 pm
by tobias
Hello,
great, thanks! Yes the script is probably better.

Without the script, unfortunately only one set of replacements can be configured, and of course they would need to be different depending on which side they are used.

Re: Replace Characters not working

Posted: Tue Apr 26, 2022 9:56 am
by Systeq
What's the encoding you're using in the script? It doesn't seem to comply with standard Unicode.

I need to add some additional entries, for example folders with "." in the name are also failing, so I need to modify those.

Thanks

Re: Replace Characters not working

Posted: Tue Apr 26, 2022 10:33 am
by tobias
Hello,
the numbers are hexadecimal character numbers from the standard Unicode set.

Do not replace periods in general. They can only be a problem in some very special cases, such as at the end of a folder or filename.

You need to determine the exact case that must be handled and address that with specific coding. I can actually amend the script for you, once you know in which exact cases the periods are a problem.

It is also possible to apply some replacements to folder names only rather than file names.

Re: Replace Characters not working

Posted: Tue Apr 26, 2022 11:09 am
by Systeq
Hi

So on further analysis it looks like I was wrong about the cause of the issue, it's not the period. It appears to be files that have characters that need replacing in both the folder and file names. As a sample of the errors:

\Data\Customers\RLO\MC:DOLS\MC꞉Dols.png (Folder does not exist: MC꞉DOLS at 00000000019CA046.CP: CloudMakeDirEx: Folder does not exist: MC‰DOLS (EFolderDoesNotExist))
\Data\Customers\RLO\MC:DOLS\What ifɁ.png (Folder does not exist: MC꞉DOLS at 00000000019CA046.CP: CloudMakeDirEx: Folder does not exist: MC‰DOLS (EFolderDoesNotExist))
\Data\Customers\RLO\MC:DOLS\Review AS 5꞉11꞉19.docx (Folder does not exist: MC꞉DOLS at 00000000019CA046.CP: CloudMakeDirEx: Folder does not exist: MC‰DOLS (EFolderDoesNotExist))
\Data\Customers\RLO\Moving:Handling\Moving꞉Handling objects.docx (Folder does not exist: Moving꞉Handling at 00000000019CA046.CP: CloudMakeDirEx: Folder does not exist: Moving‰Handling (EFolderDoesNotExist))
\Data\Customers\RLO\RLO PCS\RLO PCS and E ~ Design\GROW:Coaching Course\GROW Feedback - PB 07꞉07꞉20.docx (Folder does not exist: GROW꞉Coaching Course at 00000000019CA046.CP: CloudMakeDirEx: Folder does not exist: GROW‰Coaching Course (EFolderDoesNotExist))
\Data\Docs\Media\LinkedIn Posts\01:09\Marketing text - 01꞉09.docx (Folder does not exist: 01꞉09 at 00000000019CA046.CP: CloudMakeDirEx: Folder does not exist: 01‰09 (EFolderDoesNotExist))

The folder it's reporting as not existing does exist (for example MC‰DOLS exists) and has other files that have copied successfully within it, however none of those files have characters that need replacing in them. So it appears that \MC:DOLS\newfile1.txt will upload fine, whereas \MC:DOLS\newfile:1.txt would fail.

Re: Replace Characters not working

Posted: Tue Apr 26, 2022 11:42 am
by tobias
Hi,
OK I will test this here.

Did you modify the script? If yes, can you post your version?

Re: Replace Characters not working

Posted: Tue Apr 26, 2022 11:47 am
by Systeq
Thank you

The script is standard at the moment, I haven't made any modifications to it.