Notifications
Clear all

[Closed] FileSystemWatcher Broken?

Hello,

I’m using the FileSystemWatcher in Max 2012 right now, and unless I need to restart max/code this differently, it seems like the only functions of the Watcher that work are the Changed and .LastWrite operations.

I’ve tried using the .LastAccess method, and nothing triggers?

Anyone else run into this or know why it would happen?

Thanks!

4 Replies

No one? I saw a couple threads on here talking about it, but that’s about it.

 JHN

Are you watching on a windows machine or a linux fileserver like system. Linux doesn’t handle filesystem events like windows and thus aren’t picked up by the watcher. We experienced this the hard way just recently…

-Johan

i did a quick test at work the other day but didn’t have time to reply. i think the problem might be a core windows issue.

for example, in windows explorer:
create a .txt file ( put some text in it if you like )
if you opened it, save and close
now open it again and close without saving
check the file’s properties
at this point you would think that the ‘last accessed’ time would be updated but it isnt
now open again, add some more text, save and close.
check the file’s properties
you’ll notice the modified time was update but the accessed time remains unchanged.

since explorer can’t even tell when a file was accessed, this leads me to believe it’s a core windows issue

hmmmm… Thanks for the replies guys!

I’ve used Filewatcher in my WPF Windows App, to monitor when you change things like PSD files, and have them update the thumbnail/info in my window, which works fine.

But, for some reason the Maxscript version only likes to work with “changed” events and .lastWrite. I’m using LastAccessed or whatever in my WPF App, which was the best way to go for me in that case.

The main differences with what I’m looking at now, is doing it in Maxscript, and, it’s monitoring file changes on a network folder. BUT, it does work, just only with those couple commands I mentioned.