[Mono-dev] Problems with FileStream.Lock();

Jonathan Pryor jonpryor at vt.edu
Fri Jan 11 14:22:04 UTC 2013

On Jan 8, 2013, at 3:52 PM, Terry Watts <terry.terrywatts.com at gmail.com> wrote:
> I have looked at the exception under the debugger, that's why "E" is in the catch{ Exception E}. The exception thrown is a "lock violation"; not a "Not Supported" exception.

The exception thrown is "lock violation" because that's what it was mapped to -- io-layer's LockFile() was translating ~every fcntl(2) error into ERROR_LOCK_VIOLATION, even if the actual error was that the parameters were invalid (as was the case here). This is fixed in:


Note that Mono for Android doesn't currently have this patch.

 - Jon

More information about the Mono-devel-list mailing list