This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Jython/Python and the fly likes Jython: os.chdir() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Languages » Jython/Python
Bookmark "Jython: os.chdir()" Watch "Jython: os.chdir()" New topic

Jython: os.chdir()


Joined: Feb 06, 2004
Posts: 7
Is there a way in jython to perform the Python os.chdir()-command ?
We tried performing os.chdir('..') but the following error occurred:
Traceback (innermost last):
File "<console>", line 1, in ?
File "/home/kdg/jython-2.1/Lib/", line 56, in chdir
OSError: [Errno 0] chdir not supported in Java: ..

When we tried the dir(os)-command, the chdir-statement was present in the resulting list.
[ February 09, 2004: Message edited by: Barry Gaunt ]
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
I found this in the Jython FAQ. So it seems to be a Java VM restriction.
You could try jnios but I don't know anything about it myself, and it looks a little neglected.

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
subject: Jython: os.chdir()
It's not a secret anymore!