Compare is not detecting upper and lower case.
Compare is not detecting upper and lower case.
The Compare Directories menu says there are not differences :
My_BoxedIn_A_15
My_Boxedin_A_15
Is normal behavior ?
My_BoxedIn_A_15
My_Boxedin_A_15
Is normal behavior ?
Re: Compare is not detecting upper and lower case.
The Windows OS is case insensitive (unlike Linux) so I would assume this is normal behaviour.
Re: Compare is not detecting upper and lower case.
This is not a windows issue.
If you want to differentiate between cases you have to click on advanced options and click on checkbox 'Case'. Then you will get correct result.
If you want to differentiate between cases you have to click on advanced options and click on checkbox 'Case'. Then you will get correct result.
Re: Compare is not detecting upper and lower case.
I'm sorry but tukanos is incorrect. When comparing file contents, one can choose to include case. Filename comparisons are case INsensitive due to the nature of Windows.
A workaround could be saving the filenames into files (say via Ctrl+Shift+F6) and comparing those.
A workaround could be saving the filenames into files (say via Ctrl+Shift+F6) and comparing those.
Re: Compare is not detecting upper and lower case.
No need to be sorry. When I say something I usually have a proof what I'm saying. Most windows are indeed case insensitive, however, NTFS can differentiate between cases (I presume NTFS is the most used filesystem in the windows environment). Now question is if AS is capable of doing so that is probably the issue here. I was wrong to expect such thing from AS when the issue is using it from C/C++ runtime.mdruiter wrote:I'm sorry but tukanos is incorrect. When comparing file contents, one can choose to include case. Filename comparisons are case INsensitive due to the nature of Windows.
A workaround could be saving the filenames into files (say via Ctrl+Shift+F6) and comparing those.
I'll quote stockoverflow at http://stackoverflow.com/questions/7199 ... ve#7200533
Case sensitivity on Windows is actually implemented in how the application opens the files. NTFS can be a case-sensitive file system and can happily store files, with identical names differing only by case in the same directory.
On Windows all files are ultimately opened via the CreateFile API - If the FILE_FLAG_POSIX_SEMANTICS flag is passed to the call (and the file system being accessed is natively case-sensitive) then the file will be opened based on an exact name match. If FILE_FLAG_POSIX_SEMANTICS is not passed then the filesystem does a case-insensitive file open and will open one of the files with a matching name. If there is more than one it's undefined as to which one is actually opened.
Most C and C++ runtime implementations on Windows do not provide any access to this mechanism and never use this flag so the only way to get access to case-sensitive behaviors is to use the Windows API directly.
Re: Compare is not detecting upper and lower case.
I'm aware that NTFS is case sensitive and there is an API to use that feature. But Windows is case insensitive in nature: the Win32 API by default and the shell, both CMD and Explorer. So I can understand that Salamander does what Windows users expect: compare filenames without regard to case. Even though it can be cumbersome when interacting with other OSes, e.g. via FTP or SMB.
In any case I don't see Advanced options nor a Case checkbox in Salamander when comparing filenames.
In any case I don't see Advanced options nor a Case checkbox in Salamander when comparing filenames.
Last edited by mdruiter on 03 Apr 2017, 15:39, edited 1 time in total.
Re: Compare is not detecting upper and lower case.
It took me quite a while to investigate this issue as it got me quite interested. The answer is not at all trivial.mdruiter wrote:I'm aware that NTFS is case sensitive and there is an API to use that feature. But Windows is case insensitive in nature: the Win32 API by default and the shell, both CMD and Explorer. So I can understand that Salamander does what Windows users expect: compare filenames without regard to case. Even though it can be cumbersome when interacting with other OSes, e.g. via FTP or SMB.
I any case I don't see Advanced options nor a Case checkbox in Salamander when comparing filenames.
As you may know there are different layers to operating system (kernel, filesystem, drivers, user-space (where you have Win32 API), etc.). Now how do the different parts of Windows behave when considering case sensitivity? If Windows would be completely case insensitive or how you said "Windows is case insensitive in nature" there would not be a way for the kernel to know or use any windows tools to find out the casing on native NTFS file sytem, which is not the case (I'll demonstrate it later in this post).
When comparing filenames (alias File comparator) you have to see it, but not comparing directories (which was the original question - and I got it mixed files/directories, that was my mistake I admit). First lets talk about kernel. The default setting is case insensitivity. Is there a way to switch it on? (Warning: do not try this on production system it may damaged it!). Actually there is!
If you change the following settings the kernel will be, after reboot, case sensitive: I don't have yet a windows 7 virtual machine to try it out, it would be interesting to see how Salamander behaves under such conditions. I'm pretty sure that win32-api applications like windows explorer will not like it.
Back to the original question:
In my eyes this is not normal behavior, but it is currently beyond AS. The AS developers would have to add an regexp option for you to be able to search among casings.The Compare Directories menu says there are not differences :
My_BoxedIn_A_15
My_Boxedin_A_15
Is normal behavior ?
I tried to "hack" another tool for that purpose and that was a batch renamer - that would show you a result in the preview screen, however it is useful only for filename differentiation.
So are there other options (without the kernel knowing? The default settings). Fortunately it appear that yes.
First approach was to use native tools in the command-line like findstr:
Code: Select all
findstr /S /R "^[A-Z].*$"
Then I said to myself, having the Unix extension installed of windows maybe linux tools (as they are all POSIX compliant) should work, I don't know the reason but
Code: Select all
grep -r -G "^[A-Z].*$"
So as last resort I told my self to go to powershell, which worked excellently:
Code: Select all
Get-ChildItem -Recurse | Select-Object FullName | select-string -pattern "[h,j]" -CaseSensitive
Code: Select all
Get-ChildItem -Recurse -Directory| Select-Object FullName | select-string -pattern "[h,j]" -CaseSensitive
Please see http://locate32.cogit.net/. The only disadvantage is that you have to build a database prior searching. Otherwise than that it is really good tool.
Thank you mdruiter for getting me interested.
Last edited by tukanos on 04 Apr 2017, 09:19, edited 1 time in total.
Re: Compare is not detecting upper and lower case.
Locate32 -> Everything 1.4.1 Beta.

(The directory where I "install" Everything is named, Locate
.)
(C:\DEV\Locate\Everything.exe)

(The directory where I "install" Everything is named, Locate

(C:\DEV\Locate\Everything.exe)
WinXP Pro SP3 or Win7 x86 | SS 2.54
Re: Compare is not detecting upper and lower case.
I see, thank you for the updatetherube wrote:Locate32 -> Everything 1.4.1 Beta.
(The directory where I "install" Everything is named, Locate.)
(C:\DEV\Locate\Everything.exe)

Re: Compare is not detecting upper and lower case.
(Two separate products that do similar functions. Locate32, while great - in its time, since outdistanced by Everything.
And that said, each servers a purpose.)
And that said, each servers a purpose.)
WinXP Pro SP3 or Win7 x86 | SS 2.54
Re: Compare is not detecting upper and lower case.
Thank you for directing me to Everything, works great.therube wrote:(Two separate products that do similar functions. Locate32, while great - in its time, since outdistanced by Everything.
And that said, each servers a purpose.)