[Mono-list] FileSystemWatcher on Linux to monitor a remote NTFS share

colinjones colin_a_jones at hotmail.com
Sun Apr 5 02:00:50 EDT 2009


OK, I have now compiled a C# snippet that is essentially the same as the code
on the MSDN site and it runs fine both on a Windows machine and on Linux
running under Mono.

Functionally it works for local files on both. On Windows it will also
happily take a UNC path and monitor a remote folder. However, running on
Linux under Mono it refuses to accept a UNC path, with:

Unhandled Exception: System.ArgumentException: Directory does not exists
Parameter name: path
  at System.IO.FileSystemWatcher..ctor (System.String path, System.String
filter) [0x00000]
  at System.IO.FileSystemWatcher..ctor (System.String path) [0x00000]
  at (wrapper remoting-invoke-with-check) System.IO.FileSystemWatcher:.ctor
(string)
  at FileSystemWatcherTest.Program.Run (System.String[] args) [0x00000]
  at FileSystemWatcherTest.Program.Main (System.String[] args) [0x00000]


I have tried alsorts of different formats to try to get it to accept a UNC
like the .NET class does, but it won't do it. Is this a bug? Shouldn't the
API present the same interface as the .NET class does?

I don't think there is any point trying to mount the remote share, or
anything like that because the FileSystemWatcher class needs to parse the
UNC path to get the remote machine name so that it can connect to the same
functionality on the remote machine using COM communications. 

-- 
View this message in context: http://www.nabble.com/FileSystemWatcher-on-Linux-to-monitor-a-remote-NTFS-share-tp22836300p22890797.html
Sent from the Mono - General mailing list archive at Nabble.com.



More information about the Mono-list mailing list