file access in jythonc

John Howard python473 at yahoo.com
Sat Aug 28 16:15:10 EDT 2004


Alan Kennedy <alanmk at hotmail.com> wrote in message news:<MQJVc.25394$Z14.7905 at news.indigo.ie>...
> [John Howard]
> > I have the following in a jythonc program to be executed in a html
> > file.
> > 
> > f1 = open("filename","r")
> > 
> > I get message about filePermission read error. Program compiles and
> > jar file is created. Just the html code gives message.
> > 
> > Any ideas?
> 
> I am presuming that when you say "executed in a html file" you mean that 
> this code is to be embedded in a rendered html page as displayed in a 
> browser, such as mozilla or ie, which means that your code is an 
> "applet", and thus allowed to execute only in the "applet sandbox" 
> inside that browser. Which significantly restricts the access rights of 
> the applet to access system resources such as local files, for a range 
> of very good security reasons, described here
> 
> http://java.sun.com/docs/books/tutorial/applet/overview/security.html
> http://java.sun.com/docs/books/tutorial/security1.2/overview/
> 
> You can approach the problem by
> 
> 1. Digitally signing your applet or jar file.
> http://www.jguru.com/faq/view.jsp?EID=11475
> 
> 2. Configuring the your browser to permit file access to local files 
> (potentially opening a massive security hole in your browser).
> http://www.developer.com/java/ent/article.php/630621
> 
> HTH,
Yes, you are correct. I do want to execute in html page. I need read
access only for a file that is already there from another source. It's
unclear to me exactly where the filepermission code goes. In the
jython program? I looked at my ie parameters and saw no place to
change access to files. I did a search in altavista on FilePermission
and it looks like a lot of others also have questions. Can this even
be done with jythonc? It seems to me that being able to do so opens up
many, many possibilities for useful code!



More information about the Python-list mailing list