Re: [MonoTouch] UnauthorizedAccessException while accessing resources

2011-11-06 Thread Matthieu Laban
It was, thanks guys! Matt On Mon, Oct 31, 2011 at 8:26 AM, Sebastien Pouliot sebast...@xamarin.comwrote: Hello, That's a common* mistake. *common enough so there's a Gendarme rule to catch this

Re: [MonoTouch] UnauthorizedAccessException while accessing resources

2011-10-31 Thread Jeff Stedfast
Hi FlyingDevStudio, FileStream(filename, FileMode.Open); tries to open the stream as ReadWrite as per [ http://msdn.microsoft.com/en-us/library/47ek66wy.aspx ], this is probably the reason for the failure. Hope that helps, Jeff On Sat, Oct 29, 2011 at 8:24 PM, flyingdevstudio

Re: [MonoTouch] UnauthorizedAccessException while accessing resources

2011-10-31 Thread Sebastien Pouliot
Hello, That's a common* mistake. *common enough so there's a Gendarme rule to catch this https://github.com/spouliot/gendarme/wiki/Gendarme.Rules.BadPractice.UseFileOpenOnlyWithFileAccessRule(2.10) Sebastien On Mon, Oct 31, 2011 at 11:21 AM, Jeff Stedfast j...@xamarin.com wrote: Hi

Re: [MonoTouch] UnauthorizedAccessException while accessing resources

2011-10-29 Thread flyingdevstudio
Actually solved the problem... Not sure what changed, if it's our code or something in the implementation of FileStream, but using a different overload of the FileStream constructor solved the problem. This one works: var fileStream = FileStream(filename, FileMode.Open, FileAccess.Read,