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

Danny dgortonii at gmail.com
Sun Apr 5 02:11:31 EDT 2009


I think if you use a mount point, the FileSystemWatcher would then be 
unaware of the fact that the directory being watched is in fact on a 
Windows machine (abstraction) and that seems like a logical thing to try 
to me.  The only thing I'm wondering is whether the mount type needed 
(cifs) will support the FileSystemWatcher's needs, which I am not 
familiar with.

colinjones wrote:
> 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. 
> 


More information about the Mono-list mailing list