Why ignore leading and trailing spaces?

Discuss new features and functions
Posts: 8
Joined: 14 Jun 2016

JustOneLook

There's a new feature in the changelog of FFS 13.4 that I'd like to give my 2 cts about:

"Ignore leading/trailing space when matching file names"

Changes like that may produce confusion down the like. For instance, I have a transparent encrypter that will see any difference in file names as different files and I'd very much prefer FFS to do the same. I always enjoyed FFS for its precision in such things. If it now begins to undermine this principle, its filters will become less and less reliable too.
And once you start in this direction, it may lead to the situation that the file names "one and a quarter pints of beer.txt" and "1.25 pints of beer.txt" will point to the same file since mathematically the names represent the same amount of beer.
Has this been requested by the userbase anyway? And if so, why?

I hope this change will be reverted.
Posts: 21
Joined: 17 Nov 2022

FreeFileLove

It's an interesting issue, and I agree that it's not good to ignore differences. I think we need to understand why a file may have leading or trailing spaces. If it could be intentional, yes, I agree that FFS should treat differences as differences.

To better understand this issue:
Which file systems support leading spaces in file names?
Which file systems support trailing spaces in file names?
User avatar
Site Admin
Posts: 7052
Joined: 9 Dec 2007

Zenju

You're misunderstanding the feature. FreeFileSync still treats these file names as different, but matches them as pairs after comparison.
Posts: 943
Joined: 8 May 2006

therube

I'm misunderstanding, missing the distinction. Explain?
.
1. files with leading spaces, trailing spaces, & both leading & trailing spaces.
- the $ sign is the EOL marker, "showing" that the X-files do indeed have trailing spaces
2. 13.3
3. 13.4
- note that i am also displaying = files, & that there is the 1 file i updated after the initial sync
.
FreeFileSync file names with leading trailing spaces 133 vs 134.png
FreeFileSync file names with leading trailing spaces 133 vs 134.png (182.42 KiB) Viewed 294 times
Posts: 943
Joined: 8 May 2006

therube

Oh, so you're saying that when (alpha) SORTING the list of names leading/trailing spaces are ignored,
such that all the X-files are grouped together, & all the S-files are grouped together.

Ah, OK.
User avatar
Site Admin
Posts: 7052
Joined: 9 Dec 2007

Zenju

Oh, so you're saying that when (alpha) SORTING the list of names leading/trailing spaces are ignored, therube, 05 Mar 2024, 17:10
Exactly!
"file.txt" and " file.txt" will be shown as a renamed file on a single row rather than two rows (1. exists left only, 2. exist right only), in the same way that
"File.txt" and "file.txt" is also matched on one row.