Folder watch


#1

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

Thanks


#2

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.


#3

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


#4

feature request + 1

Should be very helpfull :slight_smile:


#5

+1


#6

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


#7

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.


#8

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
thanks.


#9

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


#10

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.


#11

Check out FileSystemWatcher in my module Gin: https://github.com/FigBug/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.