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


#1

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.


#2

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.


#3

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).


#4

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


#5

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


#6

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.


#7

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


#8

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.


#9

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


#10

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…


#11

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 + \ )


#12

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.


#13

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