[Mono-list] Opening a read only file

Daniel Jackson carpman at gmail.com
Tue Feb 6 09:43:24 EST 2007


Sepecifying FileAccess did it. I'm kinda new to C#, I didn't know about
those parameters. Thanks!

On 2/6/07, Matthijs ter Woord <matthijsterwoord at gmail.com> wrote:
>
> 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
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>



-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20070206/c2ede242/attachment.html 


More information about the Mono-list mailing list