Plugin file system questions

Godot Version

4.2.2.stable.mono

Questions

Hi, I’m new to plugin development (and Godot in general). I want to add support for compute shaders written in Slang via a plugin. I have a rough idea of how I want to implement it but I am a bit lost on some of the finer details.

I want the plugin to track the files in the res:// folder and for every .slang file it finds, compile it to spirv and save it in a cached location. Since the spirv isn’t required it doesn’t need to be in the main assets folder.

The problem I have at the moment is I can’t seem to find if Godot has some kind of file watching mechanism that would allow me to keep track of when a file with a specific extension has been saved so I can run a command that will compile the shader.

The other issue I have is trying to save the spirv files to a known location that can then be loaded later. I have seen that there is an EditorPaths class, but it seems that none of them point to the .godot folder. This is where I was hoping to save the intermediate spirv files since they would be regenerated if they were ever missing (because of a .gitignore file for example)

Any help would be appreciated. Thanks