Microsoft Windows reads data from the wrong file or folder
Summary: When a file system contains same-spelled but differently-cased objects in the same location, Microsoft Windows can read data from a "wrong" file or folder.
Symptoms
Client side observed behavior:
- Receiving content from "FILENAME" when opening "filename" (data is read from a "wrong" file)
- Repeatedly opening "filename" provides data either from "filename" or "FILENAME" randomly
- Microsoft Office saving a file to a "wrong folder" (in case there are different-cased folders)
Client has a same-spelled but differently-cased objects in the same file system location, like.
..\DIR-NAME\ ..\Dir-name\ ..\dir-name\
..\FILENAME ..\Filename ..\filename
Microsoft File Explorer properly shows differently-cased objects as different files/folders.
Packet traces taken while opening a location with same-spelled but different-cased objects shows a Server Message Block (SMB) response from PowerScale containing both objects ('FILENAME' and 'filename'). All other subsequent operations are performed on the object with precise spelling and casing specified by the client.
Cause
Microsoft Windows is not case-sensitive, however, modern file systems used by Windows do support case-sensitivity.
See the following Microsoft document:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
Naming Files, Paths, and Namespaces
...
Naming Conventions
...
Do not assume case sensitivity. For example, consider the names OSCAR, Oscar, and oscar to be the same, even though some file systems (such as a POSIX-compliant file system) may consider them as different. Note that NTFS supports POSIX semantics for case sensitivity, but this is not the default behavior.
Resolution
Avoid having same-spelled but differently-cased objects in the same location accessed by Microsoft Windows.
Additional Information
Windows would not allow creation of files named 'somefile' and 'SOMEFILE' in the same location - Windows produces "already exist" error.
However, a file system can end up with differently-cased objects in various ways, for example:
- creating differently-cased objects from any POSIX-compliant operating system (for example Linux)
- restoring using non-Windows backup (snapshots, Tivoli, so on) containing both 'SOMEFILE' and 'somefile' which existed at different times.
When working in Microsoft Office, the file saving process involves deletion of the original file and saving a temporary file into the original filename. That process can lead to unexpected results when there are same-spelled but differently-cased folders or files.