lwblackledge / file-watcher

An open file watcher for Atom that will prompt when the file on disk has changed.
MIT License
34 stars 7 forks source link

Doesn't work if file is deleted and created again. #13

Open dyyybek opened 8 years ago

dyyybek commented 8 years ago

I'm working on an ePub and very often unzip it to edit it's contents. It involves using a script to unzip the .epub package. The script gets rid of the old folder first and then creates a new one with the same name. I understand that file-watcher is just loosing track of the original files therefore it's not reporting any changes in the files. It would be nice to have this functionality. Even worse is that atom itself requires to close the current file and open it again from tree view.

To reproduce:

  1. create a folder "test"
  2. create a file "test.txt" inide "test" folder
  3. open the file in atom using the tree view, type in some text, save file
  4. delete the folder "test" and it's contents
  5. create the folder "test" again
  6. create the file "test.txt" inside "test" folder again
  7. switch back to atom (there are no prompts that the files were changed or deleted)
  8. do not close the file in atom – try to open the same file from the tree view (it brings the focus to your opened file but your not really editing the file from the tree view)
  9. to edit the new "test.txt" file: close the file in atom. open it again with tree view.

I hope you see the problem. I'm not sure if it's atom's issue but i hope you could add this functionality to you plugin. Cheers!

lwblackledge commented 8 years ago

Hm, I might be able to listen for the deleted event from pathwatcher and prompt to do something. However, it looks like this is an issue with how node/atom treats files overall.

MartinBonner commented 7 years ago

This is a duplicate of #19 isn't it? (Or at least, very closely related.)

xgdgsc commented 6 years ago

I use google log to a file. And the logs get rolled everytime I build and run my program. Hope this can be implemented.