PDA

View Full Version : watch for a file change vs. folder change



kwaugh
February 4th, 2010, 05:51 PM
I have a scenario where I'm trying to watch 1 file in a folder for changes. Many of the files can change as well, but I'm only interested in 1 particular file. The name never changes, just the update time.

I tried using CreateFolderWatcher specifying the file name vs a folder name with no luck.

function watchfunc() print("watchfunc") end
watcher = win.CreateFolderWatcher(

"C:\\Program Files\\wdisplay\\webfiles\\customtextout.txt", watchfunc, 56, 0)
watcher:print()

Can anyone help me out here?

Thanks!

K

Rob H
February 5th, 2010, 01:51 AM
I think you'll just have stick with the folder changing, then add a bit of code to see if your file has changed using something like win.Files(filePath) to get at the file attributes.