[Mono-list] Opening a read only file

Matthijs ter Woord matthijsterwoord at gmail.com
Tue Feb 6 09:37:43 EST 2007

Try to specify the FileShare mode....

Daniel Jackson wrote:
> This might be answered somewhere else, if it is I'm sorry to waste 
> bandwidth, but I seem to have an odd problem. I'm trying to open a file 
> that I have read only permissions to as read only. This is the code I use:
> FileStream mimeTypesFile = File.Open("/etc/mime.types", FileMode.Open);
> This produces a System.UnauthorizedAccessException. If I set 
> /etc/mime.types to rw everything works. Is this a bug, or is there 
> another way to open a file read only?
> -- 
> http://www.voidptr.org
> ================
> On no, not I,
> I'll CLI!
> As long as I have Bash to use
> I know I'll feel alive
> ------------------------------------------------------------------------
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list

More information about the Mono-list mailing list