Notepad++ deletes and rewrites files on "save", thus deleting all the file attributes and metadata.
I've investigated, fixed and test-case verified the issue. It is a two-party at fault problem.
NPP is not using "wb+" (so not indicating it is a update to any existing file).
Microsoft has a CRT error in the lib for "generic_fopen" (Unicode and ANSI); which I filed on VisualStudio CRT with Microsoft.
Sad to see such a bad (code design) bug in Microsoft's CRT core; I worked in Microsoft DevDiv as an Architect for many years.
Required changing PowerEditor/src/ScitillaComponent/Buffer.cpp lines 881 and 1070 to use "wb+" rather than "wb".
Required more "munging" because I had to use "ab+" then make it look like it had been invoked with "wb+". Those changes were in PowerEditor/src/Utf8_16.cpp lines 20 (to include <io.h> and 278.
LINE 20: #include <io.h> // dsim: Patch bad fopen + mode
LINE 278:
Notepad++ deletes and rewrites files on "save", thus deleting all the file attributes and metadata.
I've investigated, fixed and test-case verified the issue. It is a two-party at fault problem.
NPP is not using "wb+" (so not indicating it is a update to any existing file).
Microsoft has a CRT error in the lib for "generic_fopen" (Unicode and ANSI); which I filed on VisualStudio CRT with Microsoft.
Required changing
PowerEditor/src/ScitillaComponent/Buffer.cpp
lines 881 and 1070 to use "wb+" rather than "wb".Required more "munging" because I had to use "ab+" then make it look like it had been invoked with "wb+". Those changes were in
PowerEditor/src/Utf8_16.cpp
lines 20 (to include<io.h>
and 278. LINE 20:#include <io.h> // dsim: Patch bad fopen + mode
LINE 278: