Sublime Forum

Is it possible to be notified of changes to the files in the active folders from a plugin?

#1

I would like to be notified in my plugin whenever an active file or folder is:

  • created
  • renamed
  • moved
  • deleted

I know that on_new might be useful for notifications of creating new files but I am wondering about the others.

If a file or folder is moved I would also like to know where it was before the move and where it is after.

Is this info available from the sublime API (in a platform independent way)? Any suggestions would be appreciated.

1 Like

#2

Nope, but you can use https://pythonhosted.org/watchdog/

1 Like

#3

That library appears to have several dependencies. I understand that if it is a standalone library it is easy to use in a sublime plugin. As a noob, how would one go about using it in the plugin?

0 Likes

#4

Here’s a package I reviewed recently which includes watchdog: https://github.com/ppalex7/SourcePawnCompletions

It doesn’t seem to include any of its dependencies however and I never tested if the package actually worked (that’s not my job).

2 Likes