1

I have a folder which contains some read-only files. I found out that with a so-called WatchService [1][2] I can monitor create, delete or modified events in this folder. But what I need is a notification when a user opens, copies and/or moves one of the files inside the folder to a new location.

Is this possible? Can someone point me into the right direction?

Thanks in advance!

[1] ... http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher(v=vs.110).aspx

[2] ... http://docs.oracle.com/javase/tutorial/essential/io/notification.html

Chris
  • 3,057
  • 5
  • 37
  • 63
  • 1
    Shouldn't you be watching that folder's parent then? – Rotem Jun 23 '14 at 16:19
  • I meant if the user opens, copies or moves the files **inside** the folder. I'll clear it up :) thanks – Chris Jun 23 '14 at 16:21
  • 1
    Copy is a create, move is a delete and create. open is a bit more involved but it's ben asked before. http://stackoverflow.com/questions/14779616/filesystemwatcher-used-to-watch-for-folder-file-open – Tony Hopkinson Jun 23 '14 at 16:25
  • @TonyHopkinson Why is copy a create? The user copies the file **from** my folder into another one (that I'm not watching). Will I get a notification for this? – Chris Jun 23 '14 at 16:27
  • nope pretty hard for it to notify you about a new folder you don't know that you aren't watching.... – Tony Hopkinson Jun 24 '14 at 16:31

0 Answers0