Discussion:
Error Permission
(too old to reply)
pedrokas
2008-05-18 20:17:00 UTC
Permalink
Hi,

I developed a class that read text files with the command "inFile = new
AsciiIO (fileName,'R');".

When i execute the class with double-click in AOT, i don't have problems,
but if i create a batch and associated this batch to my class i get error of
filePermission.

Somebody can help me?
Luegisdorf
2008-05-19 11:21:01 UTC
Permalink
Hi Pedrokas

I guess, you let the batch run on server and therefore you need a
fileIOPermission before you can create a new AsciiIo.

Like this:

fileIOPermission = new
FileIOPermission(fileName,SysDataExpImp::readWrite2Mode(ReadWrite::read));
fileIOPermission.assert();

// and then ...
asciiIo = new AsciiIo('thisAndThatPath', 'r')


Hope this helps.
Best regards
Patrick
Post by pedrokas
Hi,
I developed a class that read text files with the command "inFile = new
AsciiIO (fileName,'R');".
When i execute the class with double-click in AOT, i don't have problems,
but if i create a batch and associated this batch to my class i get error of
filePermission.
Somebody can help me?
pedrokas
2008-05-19 17:25:01 UTC
Permalink
Thanks Luegisdorf!!
Post by Luegisdorf
Hi Pedrokas
I guess, you let the batch run on server and therefore you need a
fileIOPermission before you can create a new AsciiIo.
fileIOPermission = new
FileIOPermission(fileName,SysDataExpImp::readWrite2Mode(ReadWrite::read));
fileIOPermission.assert();
// and then ...
asciiIo = new AsciiIo('thisAndThatPath', 'r')
Hope this helps.
Best regards
Patrick
Post by pedrokas
Hi,
I developed a class that read text files with the command "inFile = new
AsciiIO (fileName,'R');".
When i execute the class with double-click in AOT, i don't have problems,
but if i create a batch and associated this batch to my class i get error of
filePermission.
Somebody can help me?
Peter Wald
2011-02-16 12:47:54 UTC
Permalink
Thanks Luegisdorf. It solved also my problem.
Kind regards,
Peter
Post by pedrokas
Hi,
I developed a class that read text files with the command "inFile = new
AsciiIO (fileName,'R');".
When i execute the class with double-click in AOT, i don't have problems,
but if i create a batch and associated this batch to my class i get error of
filePermission.
Somebody can help me?
Post by Luegisdorf
Hi Pedrokas
I guess, you let the batch run on server and therefore you need a
fileIOPermission before you can create a new AsciiIo.
fileIOPermission = new
FileIOPermission(fileName,SysDataExpImp::readWrite2Mode(ReadWrite::read));
fileIOPermission.assert();
// and then ...
asciiIo = new AsciiIo('thisAndThatPath', 'r')
Hope this helps.
Best regards
Patrick
Post by pedrokas
Thanks Luegisdorf!!
Submitted via EggHeadCafe
SharePoint Tip / Thought of the Day WebPart
http://www.eggheadcafe.com/tutorials/aspnet/14280ff8-3c9f-46bd-8214-9267e613c8ec/sharepoint-tip--thought-of-the-day-webpart.aspx
Loading...