When atom is open, i cannot delete the directory with e.g. mvn clean


When I have atom open it apparently stays in the current directory of a file that is open so that the directory is locked and cannot be delete (under Windows).

Lets say I a maven project that generates and stores adoc files in a directory project/target/docs/adoc/file.adoc

When I open the adoc directory to view and edit the file, running mvn clean fails since the directory project/target cannot be deleted (its locked by Windows due to atom).

It would be better to either implement the file update check in a way that doesn’t stay in the directory or to have an option to disable the file checks or to disable the file checks when the editor window isn’t in front.

I am currently using atom 0.199.0 in Windows 7 64 with the asciidoc preview plugin.

Edit: I have verified the same operation with Eclipse in Windows (i.e. keeping a file open and running maven in another window and it looks like Eclipse is doing the file change check if the Eclipse window is coming to the foreground so that the file or directory is not locked most of the time.


So, do I understand correctly that you want to delete a file while it is still opened/locked by another process?

That’s very un-Windows of you.


well, I think I want to delete a file that is locked but shouldn’t be or I want to delete a directory that shouldn’t be locked at all.

This works quite well for example with Eclipse or Notepad++ (or with Notepad, but that doesn’t do automatic reload checks).


So, just monitoring a file for changes using a file system watcher locks files on Windows now? When did that happen?


No, it doesn’t or rather the implementation shouldn’t do that, but apparently it does.


Most windows apps read a file and then close the file for others to act on. All of Microsoft apps like Word and Excel go out of their way to lock the files.


Yes I suppose that’s my experience and I may be stereotyping Windows apps.


Windows 10.
Directories are locked by Atom (with --clean).

I’m seeing it right now in Process Explorer.
It keeps open file handles to any expanded directory. When collapsed - it closes them.


As this issues is not (yet) resolved. Did you create an issue?
I too experienced this: the project tree locks directories.


What’s up Atom? It’s very annoying that I need to close down atom and restart it (and select my project folder again because I have another instance of Atom running that won’t allow me to reopen my just-closed project…) every time I switch a branch that has different folder/files configuration…


What’s up @elis! Try closing the tree view temporarily while you run your commands. Not the best but the hotkey should save you some time ( Ctrl + \ )


Has this been resolved? I love Atom but if I can’t run my build jobs while working on something, I can’t use Atom.


This is the fix, and it’s insane! Thanks a lot for the note!