Automatically Replace Illegal Characters in File Name

Discuss new features and functions
Posts: 1
Joined: 16 Jul 2020

LunisequiouS

I've been having issues synchronizing files from Google Drive because files and folders in Google Drive can have extra characters that aren't supported in Windows (such as :, /, ; |, etc).

Currently, FreeFileSync does not detect if you already have copies of those files with the illegal characters replaced with an underline. It also does not automatically adjust the filenames when downloading, simply throwing an error. This makes it very difficult to sync large Drive folders if there are many files using the illegal characters.

Please add an option to automatically detect and replace illegal characters in file and folder names. This would also be very useful when syncing files with Linux which is far more liberal with what characters are considered illegal. This is basic functionality that I'm genuinely surprised is missing from a software as robust and developed as FreeFileSync. Please consider adding support.

Thank you.
Posts: 1
Joined: 23 Nov 2020

zybersup

+1

I also love this feature.

However, if there are 2 files with one of different illegal characters placed at the same position in their names, how can FreeFileSync solve the problem? By using characters mapping table maps them to different character?

Anyway, I think supporting only basic case (single file) is good enough for almost everyone. Please consider adding it.

Thank you.
Posts: 1
Joined: 5 Sep 2023

ffsuser3214

I also have this problem, and I really think this is an easy problem to deal with. any way to work around this?

at least let us skip this particular error automatically. I normally use automatic retry, but for this error, it would be great to skip.
Posts: 6
Joined: 28 Aug 2023

maeterlinck

+1 for this.

character remapping would probably be my preference so there is a defined route.
Could be exposed as regex to give the end user control over how this works.
Posts: 943
Joined: 8 May 2006

therube

Posts: 2
Joined: 20 Sep 2023

ffs_sah

Hi, I just created an account to report / get help with this issue.
Since my whole university is sharing notes through multiple GDrives and doesn't care about filenames,I got bugged :)
Noticed it because on Windows 11 : it downloads the files from a google drive then creates corrupted blank files on Windows you can only delete with programs such as Unlocker.

So, dotting this sub.
User avatar
Posts: 3583
Joined: 11 Jun 2019

xCSxXenon

I am not sure how easy it would be, but YT-DLP has flags to restrict filenames. There is an option specifically for Windows "--windows-filenames" that makes the output file name safe for Windows. That is built upon Python so it's not identical, but they look to be using os.path which I believe enables this functionality and is compatible with all platforms. I think FFS is written in c/c++, I wonder if there is a library or function out there that has the same capability. The only issue I see is that the files you would download from GDrive now have different names locally, how do you compare them in the future if they no longer have the same name? Similar to having multiple files with the same name or ones with the same name and different casing, this may come down to users having safe naming schemes. I don't know why Google would let you name multiple things the same name in the first place, other than to make it harder to leave their service.
Posts: 2
Joined: 20 Sep 2023

ffs_sah

I understand what you mean.
I don't know either c or python, so I've no clue how hard to add the feature but since the database can compare files 2 by 2, I guess the software may create a hash for the file and keep track of the rule.
In my case, files have this rule "How to : xxxx" and the colon is not a valid char for Windows.
The software may add a filter with some regex like "seek for :" and "replace with -" and once it's done, will know with the database that "yesterday, I downloaded that file, that FFS had to rename and next time it will compare the right files two by two".