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.
It took me quite a while to investigate this issue as it got me quite interested. The answer is not at all trivial.
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).
- File_compare_casing.jpg (258.78 KiB) Viewed 13801 times
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:
- registry_kenrel_case_sensitivity.jpg (170.45 KiB) Viewed 13801 times
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:
The Compare Directories menu says there are not differences :
My_BoxedIn_A_15
My_Boxedin_A_15
Is normal behavior ?
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.
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:
However that did not work properly, probably as findstr is full of bugs (see more on stackowerflow topics)
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
did not work either.
So as last resort I told my self to go to powershell, which worked excellently:
- powershell_case_sensitive.jpg (101.35 KiB) Viewed 13707 times
Code: Select all
Get-ChildItem -Recurse | Select-Object FullName | select-string -pattern "[h,j]" -CaseSensitive
In pattern you can use regexp or simple string like "hello".
- powershell_case_sensitive_example_with_files_and_directories.jpg (34.79 KiB) Viewed 13801 times
If you want to get only directories you can do:
Code: Select all
Get-ChildItem -Recurse -Directory| Select-Object FullName | select-string -pattern "[h,j]" -CaseSensitive
and you will get:
- powershell_case_sensitive_example_with_directories_only.jpg (24.06 KiB) Viewed 13801 times
Is there a GUI tool to be used which can identify casing? Yes there is.
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.