Reputation: 765
ln -s foo /some/path/to/bar
doesn't ask whether foo exists and just creates a relative symbolic link "bar" that points to a nonexistent foo.
What is the python equivalent of this?
Upvotes: 1
Views: 856
Reputation: 682
You can do:
import os
os.symlink("foo", "/some/path/to/bar")
Because the first argument is not an absolute path, this will create a link /some/path/to/bar
pointing to the (possibly nonexistent) /some/path/to/foo
.
Upvotes: 3