Log when a plugin creates a file / folder

Discussion in 'Plugin Development' started by pmx, Aug 22, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    pmx

    I'm working on a plugin manager and would like it to be able to cleanly remove plugins by removing not only the jar but also any files created by the plugin. Is there a way I can have my plugin be notified whenever another plugin on my watch list (the ones installed via my plugin) create a file or folder?

    thanks guys
     
  2. Offline

    Shamebot

  3. Offline

    Metalmeerkat

    Can you just wipe the plugin's data folder, or am I misunderstanding?
     
  4. Offline

    pmx

    Do plugins always put their files in their data folder? I wanted to be sure I got everything but I suppose I can't really be blamed for plugins that spew files in random places :D

    Thank you I will take a look at that now. Thought I'd need something specific to bukkit but I guess watching the folder myself would work just as well :D
     
  5. Offline

    Metalmeerkat

    Hm, may be a bit tricky tracking file operations back to a specific plugin, since I'm guessing that the notifications may just say what process (bukkit or the java virtual machine) is responsible, not the actual plugin. Maybe have a registry for the odd plugin cases that break the norms of using their data files?

    Of course, you have to be careful about plugins that may overwrite/append data to files belonging-to/used-by bukkit, other plugins, or even non-minecraft files. In that case, you most certainly don't want to delete those on accident.

    Or maybe there's a blindingly simple solution that I don't see. :D
     
  6. Offline

    pmx

    Oh god yeah I'd hate for people to loose their data. I think maybe the best option would be to simply remove the plugin's data folder and explain to the server admin that files not contained in that folder will not be removed. Thanks everyone for your input.
     
Thread Status:
Not open for further replies.

Share This Page