How to create directories with names that are differing in case? (a case-sensitive CreateDirectory function)
Is there a way to do this? I use CreateFile with the FILE_FLAG_POSIX_SEMANTICS flag to create files with case-sensitive names. Now I need something 开发者_StackOverflowlike that for directories too.
Example:
CreateDirectory("aaa", NULL); and CreateDirectory("AAA", NULL); would result it 2 different directories. :)You can use the native API like David suggested (case-sensitivity is determined by the parameters to InitializeObjectAttributes()
)
Alternatively, you can use CreateFile
and specify FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_POSIX_SEMANTICS | FILE_ATTRIBUTE_DIRECTORY for dwFlagsAndAttributes and CREATE_NEW for dwCreationDisposition.
I think you need to resort to the native API and call NtCreateFile()
. I'm afraid I can't help you call the rather frightening API, but I don't believe there is anything else that could possibly allow this.
精彩评论