jythonc中的文件访问 [英] file access in jythonc

查看:55
本文介绍了jythonc中的文件访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在jythonc程序中有以下内容在html

文件中执行。


f1 = open(" filename"," r")


我收到有关filePermission读取错误的消息。程序编译和

jar文件已创建。只是html代码给出了消息。


任何想法?

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?

推荐答案

[John Howard]
[John Howard]
我在jythonc程序中有以下内容在html
文件中执行。

f1 = open(" filename"," r")

我收到有关filePermission读取错误的消息。程序编译和
jar文件已创建。只是html代码给出了消息。

任何想法?
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?




我假设当你说在html文件中执行时你的意思是

这个代码嵌入在一个呈现的html页面中,如

浏览器中所示,例如mozilla或ie,这意味着你的代码是

" applet",因此只允许在该浏览器内的applet sandbox中执行
。这显着限制了小程序访问系统资源(如本地文件)的访问权限,这是一个非常好的安全原因的范围

,这里描述

http://java.sun .com / docs / books / tutor ... / security.html
http://java.sun.com/docs/books/tutor...y1.2/overview/


您可以通过


来解决问题1.数字签名您的applet或jar文件。
http://www.jguru.com/faq/view.jsp?EID=11475

2.配置浏览器以允许文件访问本地文件

(可能会在浏览器中打开一个巨大的安全漏洞)。
http://www.developer.com/java/ent/article.php/630621

HTH,


-

alan kennedy

----------- -------------------------------------------

email alan: http://xhaus.com/contact/alan



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/tutor.../security.html
http://java.sun.com/docs/books/tutor...y1.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,

--
alan kennedy
------------------------------------------------------
email alan: http://xhaus.com/contact/alan


Alan Kennedy< al **** @ hotmail.com>在消息新闻中写道:< MQ ****************** @ news.indigo.ie> ...
Alan Kennedy <al****@hotmail.com> wrote in message news:<MQ******************@news.indigo.ie>...
[John Howard]
[John Howard]
我在jythonc程序中有以下内容在html
文件中执行。

f1 = open(" filename"," r")

我收到有关filePermission读取错误的消息。程序编译和
jar文件已创建。只是html代码给出了消息。

任何想法?
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?



我假设当你说在html文件中执行时你的意思是
这个代码嵌入在一个呈现的html页面中,如
浏览器中所示,例如mozilla或ie,这意味着你的代码是一个
applet,因此只允许在该浏览器内的applet沙箱中执行。这显着限制了小程序访问系统资源(如本地文件)的访问权限,这是出于非常好的安全原因,这里描述了

http://java.sun.com/docs/books/tutor ... / security.html
http://java.sun.com/docs/books/tutor...y1.2/overview/

您可以通过
来解决问题
1.对您的applet或jar文件进行数字签名。
http://www.jguru.com/faq/view.jsp?EID=11475

2.配置浏览器以允许文件访问本地文件
(可能会在您的浏览器中打开一个巨大的安全漏洞)。
http://www.developer.com/java/ent/article.php/630621

HTH,



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/tutor.../security.html
http://java.sun.com/docs/books/tutor...y1.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,



是的,你是对的。我想在html页面中执行。我需要阅读

只能访问已经来自其他来源的文件。这是

我不清楚filepermission代码的确切位置。在

jython程序中?我查看了我的ie参数,并没有看到

更改文件访问权限的地方。我在FilePermission上搜索了altavista

,看起来很多其他人也有问题。这甚至可以用jythonc来完成吗?在我看来,这样做可以打开很多很多有用代码的可能性!


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!


py ******* @ yahoo.com (约翰霍华德)在留言中写道:< 9e ******** *****************@posting.google.c om> ...
py*******@yahoo.com (John Howard) wrote in message news:<9e*************************@posting.google.c om>...
我在jythonc程序中有以下内容在html中执行
文件。

f1 = open(" filename"," r")

我收到有关filePermission读取错误的消息。程序编译和
jar文件已创建。只是html代码给出了消息。

任何想法?
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?




我已查阅下面的参考资料并完成了几次搜索/>
filepermissions。在我看来,jythonc在

开发实用中有任何用处。产品,程序必须能够轻松地访问本地文件。如果没有,那么在我看来,这将成为jython的主要问题。

!我喜欢在python中编程的语法和易用性,但是如果它不能用于有用的程序,那么为什么要打扰?b $ b为什么这么麻烦?! BTW,java如何处理这个?那是同样的问题

呢?



I''ve looked up the references below and done several searches of
filepermissions. It seems to me that for jythonc to have any use in
development of "practical" products, programs have to be able to
access local files easily. If not, then this, in my opinion, is going
to be a MAJOR issue for jython!! I love the syntax and ease of
programming in python, but if it cannot be used for useful programs,
why bother?! BTW, how does java handle this? Is the same problem there
also?


这篇关于jythonc中的文件访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆