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

Terry-Watts.com Terry at Terry-Watts.com
Wed Jan 9 08:10:08 UTC 2013

Thanks very much for looking into it. I had realised that the SD card 
file system was limited, but I didn't realise that the internal Android 
file system was also limit "small file support". The change works like a 

Thanks very very much.

On 9/01/2013 4:23 PM, Jonathan Pryor wrote:
> On Jan 7, 2013, at 4:50 PM, Terry-Watts.com <Terry at Terry-Watts.com> wrote:
>> I have a class that work fine in C# under Windows but not under Monodroid.
> This is a mono bug: https://bugzilla.xamarin.com/show_bug.cgi?id=9411
> Thinking about it a but more, though, it's an app bug (+ mono bug).
> The problem is that Android doesn't have "large file support" (meaning userspace is limited to 32-bit values for file offsets/etc.). Your code, meanwhile, is specifying a 64-bit value for the file range.
> fcntl(2) cannot accept a 64-bit value for the size of the file region to lock; it needs to be a signed 32-bit value.
> Fix: use `int.MaxValue`, not `long.MaxValue`.
> Mono should probably throw an exception in this scenario.
>   - Jon

More information about the Mono-devel-list mailing list