Folder watch

Is there an object in Juce that watches changes in folders ?


No… This is a request that comes up fairly often, but I’ve never quite got around to doing one. The annoying bit is that to do this requires a thread, so isn’t quite as simple as you’d expect.

That is exactly the reason why I was hoping to find something in juice :smiley:

feature request + 1

Should be very helpfull :slight_smile:


I actually have some half-written code lying around to do this, but never got chance to finish it…

If you use inotify, you don’t need a thread, since you can select on the returned file descriptor like you already do in your message thread (adding the file descriptor to the list you’re selecting upon already).
I don’t know for Windows & Mac however.

Dear Jules,
Did you or your team got any finished implementations of this pretty interesting feature?
It would be very nice to see a method like
browserContentChanged inside FileBrowserListener

1 Like

No, I don’t think anyone ever did that!

Perhaps something has been done in the last month regarding this aspect?

I’d need to trigger the refresh of a DirectoryContentsList when something inside the listed directory changes.

Check out FileSystemWatcher in my module Gin:

It will give a callback if anything in the folder changes, on Windows & Mac it will tell you specifically what changed (ie file delete, added, modified, etc). I still need to implement that for Linux.