EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Case Sensitive Drive

Posted: 06/08/2016 03:28:28
by Rony Fragin (Standard support level)
Joined: 05/23/2016
Posts: 6


All the samples are for case insensitive drives. I'm trying to make mine case sensitive, and I have an issue when I'm creating a "c.txt" file after creating a "C.txt" file (Creating a new file with the same name but a different case).
When I create a new txt file and rename it to "c.txt", the file disappears and only "C.txt" shows up in the directory. After I refresh the folder, both files appear in the directory.

I checked the logs and I do return the write answers on EnumerateDirectory() and GetFileInfo().

I also have this in my code:

mCbFs.CaseSensitiveFileNames = true;

Please help :\


Just switched to case insensitive and dropped the matter...
Posted: 06/08/2016 10:05:51
by Volodymyr Zinin (Team)

Windows by itself is case insensitive. So Windows programs expect files to be opened by specifying any case insensitive file name. From their view the file names "file.txt" and "FiLe.TXT" belong to the same file.
CBFS in most cases tries to use an exact case sensitive file name during file opening and others operations. But sometimes it fails. For example there are two files "file.txt" and "File.txt". No one is opened yet. Then some program opens "File.txt" and later another program is opening "file.txt". During the last opening the CBFS driver sees that the open request isn't case sensitive (there is a special flag that specifies that) and there is already opened "File.txt". So the metadata for "File.txt" is used for the last opening and finally the file "File.txt" will be opened.
Regarding the CallbackFileSystem.CaseSensitiveFileNames property. It matters only to support applications for UNIX (Interix) subsystem. For example if your CBFS application wants to support the service for NFS shares. When this property is set CBFS checks whether the application during file opening specifies a case sensitive name and allows to open file only in the case of strict correspondence. But for other openings CBFS still treats file names as case insensitive.
I know only one way to open files as case insensitive - it's done by the use of NT-API, like ZwCreateFile and ZwOpenFile. There is a flag there OBJ_CASE_INSENSITIVE. Also in the registry it is required to set a special flag which tells Windows to support case sensitive file names. Here is a n information about it http://technet.microsoft.com/en-us/li...25747.aspx



Topic viewed 2747 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!