468,532 Members | 1,703 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,532 developers. It's quick & easy.

jython newbee general question docu / os.fstat

Hi there,

unfortunately I am new to Jython and my "Jython Essentials" book is
still in the mail. I looked into the Jython API Doc but could not find
the information.
I am porting a Python library to Jython and some parts are missing. My
question basically is where do I find information on what to use
instead. E.g. I could not find information on the os module. I do not
find the sys module docu either.
The concrete problem is I have something like os.fstat(infile.fileno())
which provokes:
IOError: fileno() is not supported in jpython.
If this question is already documented somewhere please point me to
this direction. I was not able to find it.

Best Regards,
Mark

Feb 5 '06 #1
1 2216
Mark Fink schrieb:
Hi there,

unfortunately I am new to Jython and my "Jython Essentials" book is
still in the mail. I looked into the Jython API Doc but could not find
the information.
I am porting a Python library to Jython and some parts are missing. My
question basically is where do I find information on what to use
instead. E.g. I could not find information on the os module. I do not
find the sys module docu either.
The concrete problem is I have something like os.fstat(infile.fileno())
which provokes:
IOError: fileno() is not supported in jpython.
If this question is already documented somewhere please point me to
this direction. I was not able to find it.


The general problem lies within JAVA. Instead of python that tries to
incorporate os-specific modules, it focuses of a common subset -
excluding lots of functionality. fstat and lots of functions in os are
not available - for example, you can't change the current working
directory. fstat is a posix-call, which is also not available.

The general rule of thumb is: whenever you encounter something missing,
try to find a solution for java. That could e.g. be a JNI-interfaced
special library to access the com-port or something else. If such a
solution exists, use that (its easy enough from jython). If not - bad luck.

Diez
Feb 5 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Dave Benjamin | last post: by
4 posts views Thread by angel | last post: by
reply views Thread by Charles Griswold | last post: by
reply views Thread by Mark Fink | last post: by
12 posts views Thread by Mark Fink | last post: by
8 posts views Thread by Mark Fink | last post: by
11 posts views Thread by solarisss | last post: by
2 posts views Thread by =?ISO-8859-1?Q?S=E9bastien_Boisg=E9rault?= | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.