I’m working on a project that uses Jython 2.2.
Seems like Jython 2.2 doesn’t have os.symlink() or anything that can help create a symbolic link.
So I thought to use the Java createSymbolicLink(). But createSymbolicLink() requires a Java data type “Path”, which I have no clue about how to import into Jython…
Does anyone have any idea about how to create a symbolic link in Jython (preferably not using shell commands)?
P.S. I tried “createSymbolicLink()” with Java 1.6.0 and it didn’t work because somehow Java didn’t recognize “Path” even after I did “import java.nio.*”… Any idea…?
Thanks a lot!
Jack
There is no support for symlinks in Java 6. With Java 7 you could (untested):
Jython 2.5 has
os.symlink()implemented using jruby posix module.With Jython 2.2 on Java 6 you might need to call
ln:To mass produce symlinks you could communicate with external python process:
Where
symlinker.py:It is a translation to Jython/Python of Java/C implementation from Creating Symbolic Links with Java at Runtime.