Implement directory tracking in the watcher