if (Directory.Exists(monitorPath)) { watcher.Path = monitorPath; watcher.IncludeSubdirectories = true; watcher.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.CreationTime; watcher.InternalBufferSize = 65536; watcher.Filter = "test_prod-Pg1_ICT*"; watcher.Changed += new FileSystemEventHandler(fileChangedEvent); watcher.EnableRaisingEvents = true; LogEvent("Folder Syncronization Service is Started!"); }
I created a Windows Service FileSystemWatcher-based class to monitor the Samba onChanges shared folder and used the DifferenceEngine from CodeProject to check different versions and copy them to the shared path to the Windows folder if there are changes. I also added a timer to check every 10 seconds when the network fails. There is an array of lists to keep track of changes. Added to the list when an event with a modified file is added and the List is deleted when successful.
I tested two HP laptops for laptops on Windows 7 Pro, working fine.
But it was not possible to work with another Window 7 Pro laptop, as well as with Windows XP Pro SP3 Desktop. (We are in the same company network / VLAN and Service Pack)
Failure means that if I change something in the Samba Shared Folder, it will not sync the latest content with the Windows Share Path.
I also added these
[PermissionSetAttribute (SecurityAction.LinkDemand, Name = "FullTrust")] [PermissionSetAttribute (SecurityAction.InheritanceDemand, Name = "FullTrust")]
at the top of the encoding does not seem to work
source share