Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notepad3 holds an exclusive lock for too long on save #5301

Open
chipplyman opened this issue Sep 26, 2024 · 0 comments
Open

Notepad3 holds an exclusive lock for too long on save #5301

chipplyman opened this issue Sep 26, 2024 · 0 comments

Comments

@chipplyman
Copy link

I have a process with a FileSystemWatcher that immediately reads an xml file when it changes on disk.

If I open and save that file in notepad3 (6.23.203.2), my process throws an exception:

IOException: The process cannot access the file 'c:\path\to\myfile.xml' because it is being used by another process.
      at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
      at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
      at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
      at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
      at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
      at System.Xml.XmlTextReaderImpl.FinishInitUriString()
      at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
      at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)
@chipplyman chipplyman changed the title notepad 3 holds an exclusive lock for too long on save Notepad3 holds an exclusive lock for too long on save Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant