You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Filenames containing dots lead to a "The system cannot find the file specified" sync error #7008
bugA problem with current functionality, as opposed to missing functionality (enhancement)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussionneeds-triageNew issues needed to be validated
File or directory names on Windows cannot end with a trailing dot. Probably we should reject them with an "invalid filename" error at an earlier stage.
File or directory names on Windows cannot end with a trailing dot. Probably we should reject them with an "invalid filename" error at an earlier stage.
Hmm, I can sync such files/folders between my Windows and Android machines. They can be created using
md \\?\C:\testfolder.
echo>\\?\C:\testfile.
or even
echo>\\?\C:\NUL
Although more of a hack than anything else, all of them are happily synced.
Yeah, but I am not sure if this is really the reason for the error described here though. I can synchronise them in my systems, and Syncthing does not complain at all.
However, Android does not accept something like test./test.. Windows does. I think that this may be more of a file system related problem. Windows uses NTFS, while Android uses FAT.
I'm certain it's the reason, but whether it's because our mkdir does not work precisely the same way your shell md \\?\etc does or because the filesystem or OS or registry or something is different is unclear. It doesn't matter though because the root problem is that we're attempting to do something we shouldn't (create a directory with an unsupported name).
Yes, but judging by what is going on in Android, I have a feeling that this is caused by the (ex)FAT system, and will be a problem regardless of the OS.
Just for the record, this is what Syncthing on Android says:
2020-09-28 06:44:00 Puller (folder "xxx" (xxxxx-xxxx), item "temp./temp."): syncing: resurrecting parent dir: file does not exist
It's indeed also true that FAT does not support all the things you might wish of a filesystem even when running under non-Windows. That's a different sort of problem though.
All right. The problem, I guess, will mostly be limited to Android, where FAT is common.
However, I have just seen that in the commit you included all the different reserved names like NUL, etc. but what about names followed by extensions? I mean NUL.txt, NUL.exe and similar. These are also considered "illegal" in Windows, i.e. Windows Explorer is unable to operate on them.
From the MS link:
Do not use the following reserved names for the name of a file:
CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. Also avoid these names followed immediately by an extension; for example, NUL.txt is not recommended.
It is not mentioned there, but even with multiple extensions, the file/folder will still be illegal, e.g. NUL.txt.txt and so on. Basically, anything starting with those illegal names and immediately followed by a dot seems to also be illegal.
I didn't test the illegality, just went by the "is not recommended" which I felt was less strong than "do not use" for the rest of the description. Those should apparently also be removed, yes.
I am very sorry for writing again, but I just wanted to say that there is a loophole in the current handling of the invalid filenames.
Basically, if an invalid file, e.g. CON, already exists in the folder on both sides, Syncthing will happily mark both "Up to Date". This can happen when sharing the folder for the first time with pre-existing files on both sides, or after copying the file manually to the other side. Syncthing also accepts all invalid filenames when the folder is "Unshared".
Is this OK as it is, or should Syncthing also mark these as invalid?
bugA problem with current functionality, as opposed to missing functionality (enhancement)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussionneeds-triageNew issues needed to be validated
Activity
calmh commentedon Sep 27, 2020
File or directory names on Windows cannot end with a trailing dot. Probably we should reject them with an "invalid filename" error at an earlier stage.
tomasz1986 commentedon Sep 27, 2020
Hmm, I can sync such files/folders between my Windows and Android machines. They can be created using
or even
Although more of a hack than anything else, all of them are happily synced.
calmh commentedon Sep 28, 2020
Probably some of the APIs we use don't like them. They're not supposed to exist, after all. :)
lib/model: Disallow names ending with period on Windows (fixes syncth…
lib/model: Disallow reserved names, and names ending with period on W…
tomasz1986 commentedon Sep 28, 2020
Yeah, but I am not sure if this is really the reason for the error described here though. I can synchronise them in my systems, and Syncthing does not complain at all.
However, Android does not accept something like
test./test.. Windows does. I think that this may be more of a file system related problem. Windows uses NTFS, while Android uses FAT.calmh commentedon Sep 28, 2020
I'm certain it's the reason, but whether it's because our mkdir does not work precisely the same way your shell
md \\?\etcdoes or because the filesystem or OS or registry or something is different is unclear. It doesn't matter though because the root problem is that we're attempting to do something we shouldn't (create a directory with an unsupported name).tomasz1986 commentedon Sep 28, 2020
Yes, but judging by what is going on in Android, I have a feeling that this is caused by the (ex)FAT system, and will be a problem regardless of the OS.
Just for the record, this is what Syncthing on Android says:
calmh commentedon Sep 28, 2020
It's indeed also true that FAT does not support all the things you might wish of a filesystem even when running under non-Windows. That's a different sort of problem though.
tomasz1986 commentedon Sep 28, 2020
All right. The problem, I guess, will mostly be limited to Android, where FAT is common.
However, I have just seen that in the commit you included all the different reserved names like
NUL, etc. but what about names followed by extensions? I meanNUL.txt,NUL.exeand similar. These are also considered "illegal" in Windows, i.e. Windows Explorer is unable to operate on them.From the MS link:
It is not mentioned there, but even with multiple extensions, the file/folder will still be illegal, e.g.
NUL.txt.txtand so on. Basically, anything starting with those illegal names and immediately followed by a dot seems to also be illegal.calmh commentedon Sep 28, 2020
I didn't test the illegality, just went by the "is not recommended" which I felt was less strong than "do not use" for the rest of the description. Those should apparently also be removed, yes.
lib/fs: Be even more strict about Windows names (ref syncthing#7008)
lib/fs: Be even more strict about Windows names (ref #7008) (#7012)
tomasz1986 commentedon Sep 28, 2020
I am very sorry for writing again, but I just wanted to say that there is a loophole in the current handling of the invalid filenames.
Basically, if an invalid file, e.g.
CON, already exists in the folder on both sides, Syncthing will happily mark both "Up to Date". This can happen when sharing the folder for the first time with pre-existing files on both sides, or after copying the file manually to the other side. Syncthing also accepts all invalid filenames when the folder is "Unshared".Is this OK as it is, or should Syncthing also mark these as invalid?
calmh commentedon Sep 28, 2020
I think that's fine. We try to prevent oddities. If you've managed to have pre-existing oddities you can keep them. :)
lib/fs: Add COM0 and LPT0 to invalid Windows file names (ref #7008) (#…
Merge branch 'main' into cdc
jadsongmatos commentedon Oct 19, 2020
would be able to mark a specific file to not be synchronized ?
example pet.notsync.jpg
AudriusButkevicius commentedon Oct 19, 2020
Please use the forum for questions