jython newbee general question docu / os.fstat

Diez B. Roggisch deets at nospam.web.de
Sun Feb 5 06:23:03 EST 2006


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



More information about the Python-list mailing list