Notepad++ has a Reload false alarm / bug? "This file has been modified by another program. Do you want to reload it"? even when it hadn't been recently modified at all?!
pnedev last edited by pnedev
CreateFile’s parameter about file attributes is combined with other flags.
The MSDN is saying that
FILE_ATTRIBUTE_NORMALcannot be combined with other ATTRIBUTE values (because those will overwrite
FILE_ATTRIBUTE_NORMAL) but flags are separate thing and can surely be combined with attributes. Those are basically two separate types of values combined in one variable.
Quote from MSDN from https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew :
The file or device attributes and flags, FILE_ATTRIBUTE_NORMAL being the most common default value for files.
This parameter can include any combination of the available file attributes (FILE_ATTRIBUTE_*). All other file attributes override FILE_ATTRIBUTE_NORMAL.
This parameter can also contain combinations of flags (FILE_FLAG_) for control of file or device caching behavior, access modes, and other special-purpose flags. These combine with any FILE_ATTRIBUTE_ values."
So we can safely use
FILE_FLAG_POSIX_SEMANTICSand any other
FILE_FLAG_*value together with
donho last edited by donho
Yes, that’s what I understood after reading agin MS Doc concerning CreateFile function.
However, the parameter
FILE_FLAG_POSIX_SEMANTICSto me is not useful for Notepad++. But there is maybe a reason when you coded it - I would like to know it before removing it (or not).
pnedev last edited by
You can remove
FILE_FLAG_POSIX_SEMANTICSif you like.
The reason I added it is because I am mostly using Linux in my daily work and I like the file name case sensitivity. It is a personal preference and in my opinion doesn’t harm in Windows as well.
I remember once long time ago I got a file from somewhere that was with all capitals name and when I tried to rename it to make the characters normal the system denied that claiming the name was the same. Seems that the confusion I felt back then still lingers :)
Aside from my personal preference, I am not sure if keeping that flag will be useful if Notepad++ is used for Network accessed files. I do not have much experience in that case so I’m not sure what will happen if some Network accessed location is having case-sensitive file system and in a folder there are two files with names that only differ in letter cases. I have no idea if such situation might happen either but how will Notepad++ distinguish between those files? Maybe it is something that will be handled on operating system level IDK for sure.
donho last edited by
Makes sens for this parameter. Let’s keep it then.
Thank you for your explanation.
Josef Eliáš last edited by
donho last edited by