Home All Groups Group Topic Archive Search About

File Permission System.UnauthorizedAccessException

Author
6 Sep 2005 2:01 PM
Tom
Hi friends

I am trying to modify a file on my computer but I get an error which says
the following. "System.UnauthorizedAccessException: Access to the path.

I also tried FileIOPermission

FileIOPermission fio = new
FileIOPermission(FileIOPermissionAccess.AllAccess, paramMP3.fileComplete);

FileStream oFileStream;

oFileStream = new FileStream(paramMP3.fileComplete , FileMode.Open,
FileAccess.ReadWrite);

that didn't seem to have any effect on it also.



Appreciate any help

Thanks

Tom

Author
6 Sep 2005 2:53 PM
Dominick Baier [DevelopMentor]
Hello Tom,

UnauthorizedException has nothing to do with CAS and FileIOPermission. This
is a OS level error - i would say you don't have the necessary NTFS ACLs...

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

Show quoteHide quote
> Hi friends
>
> I am trying to modify a file on my computer but I get an error which
> says the following. "System.UnauthorizedAccessException: Access to the
> path.
>
> I also tried FileIOPermission
>
> FileIOPermission fio = new
> FileIOPermission(FileIOPermissionAccess.AllAccess,
> paramMP3.fileComplete);
> FileStream oFileStream;
>
> oFileStream = new FileStream(paramMP3.fileComplete , FileMode.Open,
> FileAccess.ReadWrite);
>
> that didn't seem to have any effect on it also.
>
> Appreciate any help
>
> Thanks
>
> Tom
>
Author
7 Sep 2005 2:01 PM
Tom
Yes that is my initial thought...

however I have cheched the application is using administrator as its
identity. The effective permission for administrator is full access. I also
checked Everyone user and it also has full access under effective
permission.

I'm really not sure what else could be wrong.

Appreciate your help !
Tom

Show quoteHide quote
"Dominick Baier [DevelopMentor]" <dbaier@pleasepleasenospamdevelop.com>
wrote in message news:852930632616225320420418@news.microsoft.com...
> Hello Tom,
>
> UnauthorizedException has nothing to do with CAS and FileIOPermission.
> This is a OS level error - i would say you don't have the necessary NTFS
> ACLs...
>
> ---------------------------------------
> Dominick Baier - DevelopMentor
> http://www.leastprivilege.com
>
>> Hi friends
>>
>> I am trying to modify a file on my computer but I get an error which
>> says the following. "System.UnauthorizedAccessException: Access to the
>> path.
>>
>> I also tried FileIOPermission
>>
>> FileIOPermission fio = new
>> FileIOPermission(FileIOPermissionAccess.AllAccess,
>> paramMP3.fileComplete);
>> FileStream oFileStream;
>>
>> oFileStream = new FileStream(paramMP3.fileComplete , FileMode.Open,
>> FileAccess.ReadWrite);
>>
>> that didn't seem to have any effect on it also.
>>
>> Appreciate any help
>>
>> Thanks
>>
>> Tom
>>
>
>
>
Author
7 Sep 2005 2:22 PM
Dominick Baier [DevelopMentor]
Hello Tom,

what happens if you use a different file? maybe someone has a lock on that
file, try to pass in the 4th parameter the FileStream ctor - lockMode or
similar and set it to none - just to see what happens...

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

Show quoteHide quote
> Yes that is my initial thought...
>
> however I have cheched the application is using administrator as its
> identity. The effective permission for administrator is full access. I
> also checked Everyone user and it also has full access under effective
> permission.
>
> I'm really not sure what else could be wrong.
>
> Appreciate your help !
> Tom
> "Dominick Baier [DevelopMentor]"
> <dbaier@pleasepleasenospamdevelop.com> wrote in message
> news:852930632616225320420418@news.microsoft.com...
>
>> Hello Tom,
>>
>> UnauthorizedException has nothing to do with CAS and
>> FileIOPermission. This is a OS level error - i would say you don't
>> have the necessary NTFS ACLs...
>>
>> ---------------------------------------
>> Dominick Baier - DevelopMentor
>> http://www.leastprivilege.com
>>> Hi friends
>>>
>>> I am trying to modify a file on my computer but I get an error which
>>> says the following. "System.UnauthorizedAccessException: Access to
>>> the path.
>>>
>>> I also tried FileIOPermission
>>>
>>> FileIOPermission fio = new
>>> FileIOPermission(FileIOPermissionAccess.AllAccess,
>>> paramMP3.fileComplete);
>>> FileStream oFileStream;
>>> oFileStream = new FileStream(paramMP3.fileComplete , FileMode.Open,
>>> FileAccess.ReadWrite);
>>>
>>> that didn't seem to have any effect on it also.
>>>
>>> Appreciate any help
>>>
>>> Thanks
>>>
>>> Tom
>>>
Author
9 Sep 2005 2:38 PM
Tom
thanks for your help
but the file was readonly


Show quoteHide quote
"Dominick Baier [DevelopMentor]" <dbaier@pleasepleasenospamdevelop.com>
wrote in message news:862088632617070425393864@news.microsoft.com...
> Hello Tom,
>
> what happens if you use a different file? maybe someone has a lock on that
> file, try to pass in the 4th parameter the FileStream ctor - lockMode or
> similar and set it to none - just to see what happens...
>
> ---------------------------------------
> Dominick Baier - DevelopMentor
> http://www.leastprivilege.com
>
>> Yes that is my initial thought...
>>
>> however I have cheched the application is using administrator as its
>> identity. The effective permission for administrator is full access. I
>> also checked Everyone user and it also has full access under effective
>> permission.
>>
>> I'm really not sure what else could be wrong.
>>
>> Appreciate your help !
>> Tom
>> "Dominick Baier [DevelopMentor]"
>> <dbaier@pleasepleasenospamdevelop.com> wrote in message
>> news:852930632616225320420418@news.microsoft.com...
>>
>>> Hello Tom,
>>>
>>> UnauthorizedException has nothing to do with CAS and
>>> FileIOPermission. This is a OS level error - i would say you don't
>>> have the necessary NTFS ACLs...
>>>
>>> ---------------------------------------
>>> Dominick Baier - DevelopMentor
>>> http://www.leastprivilege.com
>>>> Hi friends
>>>>
>>>> I am trying to modify a file on my computer but I get an error which
>>>> says the following. "System.UnauthorizedAccessException: Access to
>>>> the path.
>>>>
>>>> I also tried FileIOPermission
>>>>
>>>> FileIOPermission fio = new
>>>> FileIOPermission(FileIOPermissionAccess.AllAccess,
>>>> paramMP3.fileComplete);
>>>> FileStream oFileStream;
>>>> oFileStream = new FileStream(paramMP3.fileComplete , FileMode.Open,
>>>> FileAccess.ReadWrite);
>>>>
>>>> that didn't seem to have any effect on it also.
>>>>
>>>> Appreciate any help
>>>>
>>>> Thanks
>>>>
>>>> Tom
>>>>
>
>
>
Author
7 Sep 2005 2:34 PM
Nicole Calinoiu
Might the file be marked as read-only?


Show quoteHide quote
"Tom" <tomgaom***@optusnet.com.au> wrote in message
news:431ef2b6$0$1909$afc38c87@news.optusnet.com.au...
> Yes that is my initial thought...
>
> however I have cheched the application is using administrator as its
> identity. The effective permission for administrator is full access. I
> also checked Everyone user and it also has full access under effective
> permission.
>
> I'm really not sure what else could be wrong.
>
> Appreciate your help !
> Tom
>
> "Dominick Baier [DevelopMentor]" <dbaier@pleasepleasenospamdevelop.com>
> wrote in message news:852930632616225320420418@news.microsoft.com...
>> Hello Tom,
>>
>> UnauthorizedException has nothing to do with CAS and FileIOPermission.
>> This is a OS level error - i would say you don't have the necessary NTFS
>> ACLs...
>>
>> ---------------------------------------
>> Dominick Baier - DevelopMentor
>> http://www.leastprivilege.com
>>
>>> Hi friends
>>>
>>> I am trying to modify a file on my computer but I get an error which
>>> says the following. "System.UnauthorizedAccessException: Access to the
>>> path.
>>>
>>> I also tried FileIOPermission
>>>
>>> FileIOPermission fio = new
>>> FileIOPermission(FileIOPermissionAccess.AllAccess,
>>> paramMP3.fileComplete);
>>> FileStream oFileStream;
>>>
>>> oFileStream = new FileStream(paramMP3.fileComplete , FileMode.Open,
>>> FileAccess.ReadWrite);
>>>
>>> that didn't seem to have any effect on it also.
>>>
>>> Appreciate any help
>>>
>>> Thanks
>>>
>>> Tom
>>>
>>
>>
>>
>
>
Author
9 Sep 2005 2:37 PM
Tom
you're absolutely right it was readonly... *sigh* I spent too much time
worrying other things instead of checking it

Show quoteHide quote
"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
news:u0OVio7sFHA.524@TK2MSFTNGP12.phx.gbl...
> Might the file be marked as read-only?
>
>
> "Tom" <tomgaom***@optusnet.com.au> wrote in message
> news:431ef2b6$0$1909$afc38c87@news.optusnet.com.au...
>> Yes that is my initial thought...
>>
>> however I have cheched the application is using administrator as its
>> identity. The effective permission for administrator is full access. I
>> also checked Everyone user and it also has full access under effective
>> permission.
>>
>> I'm really not sure what else could be wrong.
>>
>> Appreciate your help !
>> Tom
>>
>> "Dominick Baier [DevelopMentor]" <dbaier@pleasepleasenospamdevelop.com>
>> wrote in message news:852930632616225320420418@news.microsoft.com...
>>> Hello Tom,
>>>
>>> UnauthorizedException has nothing to do with CAS and FileIOPermission.
>>> This is a OS level error - i would say you don't have the necessary NTFS
>>> ACLs...
>>>
>>> ---------------------------------------
>>> Dominick Baier - DevelopMentor
>>> http://www.leastprivilege.com
>>>
>>>> Hi friends
>>>>
>>>> I am trying to modify a file on my computer but I get an error which
>>>> says the following. "System.UnauthorizedAccessException: Access to the
>>>> path.
>>>>
>>>> I also tried FileIOPermission
>>>>
>>>> FileIOPermission fio = new
>>>> FileIOPermission(FileIOPermissionAccess.AllAccess,
>>>> paramMP3.fileComplete);
>>>> FileStream oFileStream;
>>>>
>>>> oFileStream = new FileStream(paramMP3.fileComplete , FileMode.Open,
>>>> FileAccess.ReadWrite);
>>>>
>>>> that didn't seem to have any effect on it also.
>>>>
>>>> Appreciate any help
>>>>
>>>> Thanks
>>>>
>>>> Tom
>>>>
>>>
>>>
>>>
>>
>>
>
>