jython newbee general question docu / os.fstat

M

Mark Fink

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
 
D

Diez B. Roggisch

Mark said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top