473,791 Members | 3,074 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

file access in jythonc

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?
Jul 18 '05
13 2193
>> As I said - search google for JAVA APPLETS ACCESSING LOCAL FILES - then
you can do that using jython. As a matter of fact, the whole process has
to do with signing jars - nobody cares if these contain classes generated
by javac, jikes, jythonc or carefully handwritten jvm bytecode....


So does that mean that a jre does not have to be on the local pc? The
local pc does not have to set policies, etc. If that is true, then all
I've said about jython I take back. It is truly useful!


What exactly makes you conclude this from my above statements? And did you
even _think_ for a moment to follow my and others suggestions to search on
google?
--
Regards,

Diez B. Roggisch
Jul 18 '05 #11
Alan Kennedy <al****@hotmail .com> wrote in message news:<iQ******* ***********@new s.indigo.ie>...
[John Howard]
So does that mean that a jre does not have to be on the local pc?


No: there *must* be a JRE on the local PC: how could the java/jython run
at all without an execution environment?

The JRE on the local PC is the very thing that is preventing you from
reading files from local drives.

If you want to, you can permit any and all applet to load files from
your local drive. In Internet Explorer, select
"Tools->Options"->Security->Custom Level->Microsoft VM->Java
Permissions->Custom->Java Custom Settings.

In that control panel you can disable all of the protections that your
browser puts in place to protect you from hostile applets on the
Internet at large. Feel free to dismantle those security barriers, at
your own risk: by doing so you're opening the contents of your hard-disk
to the world. I Hope you're not storing any private or sensitive
information on there.
The local pc does not have to set policies, etc.


No, that's precisely where you set policies. Where else could they be set?

Alternatively, as others have pointed out multiple times, you can
digitally sign your applets so that they can be recognized and thus
given more permissions than unknown applets.


I said jre, but meant jvm. But your answer is revealing also! From
what you are saying, it is NOT possible to have a html page that can
access a local file unless at least a jre is present. Again, not good.
I think I'll just write the whole project in C. Forget jython!
Jul 18 '05 #12
py*******@yahoo .com (John Howard) wrote in message news:<9e******* *************** ****@posting.go ogle.com>...
Alan Kennedy <al****@hotmail .com> wrote in message news:<iQ******* ***********@new s.indigo.ie>...
[John Howard]
So does that mean that a jre does not have to be on the local pc?


No: there *must* be a JRE on the local PC: how could the java/jython run
at all without an execution environment?

The JRE on the local PC is the very thing that is preventing you from
reading files from local drives.

If you want to, you can permit any and all applet to load files from
your local drive. In Internet Explorer, select
"Tools->Options"->Security->Custom Level->Microsoft VM->Java
Permissions->Custom->Java Custom Settings.

In that control panel you can disable all of the protections that your
browser puts in place to protect you from hostile applets on the
Internet at large. Feel free to dismantle those security barriers, at
your own risk: by doing so you're opening the contents of your hard-disk
to the world. I Hope you're not storing any private or sensitive
information on there.
The local pc does not have to set policies, etc.


No, that's precisely where you set policies. Where else could they be set?

Alternatively, as others have pointed out multiple times, you can
digitally sign your applets so that they can be recognized and thus
given more permissions than unknown applets.


I said jre, but meant jvm. But your answer is revealing also! From
what you are saying, it is NOT possible to have a html page that can
access a local file unless at least a jre is present. Again, not good.
I think I'll just write the whole project in C. Forget jython!

You know, maybe I am making too much of this. I am thinking - if a jre
is there, why not just run the program as a java program?! Just have
the client load the jre and that should do it. Am I not correct?
Having thought the whole C thing over, python is still the way to go.
I apologise for being so nasty. I really did not mean to offend
anyone. You took time to respond and I do appreciate it.

Thanks!!
Jul 18 '05 #13
John Howard wrote:
Having thought the whole C thing over, python is still the way to go.

Something I've done a couple of times in the past is to follow Bruce
Eckel's "Browser as Desktop UI" model
(http://mindview.net/WebLog/log-0045). I've created a web-based
application that runs on a "client" or standalone machine. You can
either use the Python built-in SimpleHTTPServe r or CGIHTTPServer, or,
preferably, one of the Python web frameworks like CherryPy that creates
a standalone server for you. I can definitely highly recommend
CherryPy. Anyway, a standalone CherryPy server running your application
would likely solve all your problems. You just have to have Python
installed and (currently) only one .py file.

Jeremy
Jul 18 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1121
by: Henri Sivonen | last post by:
I have a Jython script that uses Java classes and runs fine using jython. It also compiles using jythonc. However, when I try to run the compiled program with the same CLASSPATH, I get an ImportError upon first Java import. How can I fix this? -- Henri Sivonen hsivonen@iki.fi
9
7162
by: BOOGIEMAN | last post by:
Just how to make *.exe file from python code ?? I typed this : a, b = 0, 1 while b < 1000: print b, a, b = b, a+b and saved it as pyt.txt
1
1651
by: Mitch Amiano | last post by:
I'm getting started working with Jython (hope this is an ok group for the question), and ran into a stumbling block using the jythonc tool. It is a fairly simple Jython script which uses the Apache Batik SVG library, imports the SVG Canvas, and puts up a simple Swing interface to let the user load and display an SVG file. (I translated the script from a Batik Java example.) The script runs fine under jython, but so far I've been unable...
0
3942
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen. It is almost like it is trying to implement it's own COM interfaces... below is the header, and a link to the dll+code: Zip file with header, example, and DLL:...
0
9669
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9517
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10428
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9030
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5435
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5559
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4110
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2916
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.