xmltools
xmltools copied to clipboard
Directory cannot be renamed or deleted after editing a contained XML file
trafficstars
If I edit an XML file with XML Tools installed, I cannot rename or delete the directory containing that file even after closing the file. I have to close Notepad++ to rename or delete the directory. To reproduce:
- Create a directory.
- Copy an XML file into that directory.
- Open the XML file in that directory in Notepad++.
- Make an edit to the XML file. (Example, add and remove a space.)
- Save the XML file.
- Close the XML file in Notepad++.
- Try to delete the file. It succeeds.
- Try to rename the directory from Windows Explorer. It fails, saying "Folder In Use: The action can't be completed because the folder or a file in it is open in another program ... Close the folder or file and try again."
- Try to delete the directory from Windows Explorer. It fails, saying "Folder In Use: The action can't be completed because the folder or a file in it is open in another program ... Close the folder or file and try again."
Versions:
- Windows 10 Professional
- Notepad++ v8.4.5 (32-bit)
- XML Tools 3.1.1.13
Other notes:
- SysInternals Process Explorer did not see a Directory handle to the directory under process notepad++.exe. However, looking at the notepad++.exe process properties in Process Explorer showed the directory as the Notepad++ current directory.
- The same behavior did not happen without XML Tools installed. I removed the XML Tools plugin from Notepad++ Plugins Admin and repeated the steps above. Without XML Tools installed, I was able to edit the file in Notepad++, close it, and rename and delete the directory successfully.
- I'm a developer but not a C/C++ developer. I debugged a little. I think the cause is setting the current directory in ToolsXmlValidate.cpp line 24, where performXMLCheck() calls _wchdir(currenPath). There is a similar call in XmlValidation() in the same file.