__init__.py 400 B

12345678910
  1. import os
  2. def symlink(source, link_name, relative = False): #, override = False):
  3. if relative:
  4. source = os.path.relpath(source, os.path.dirname(link_name))
  5. # os.path.lexists() returns True if path refers to an existing path and
  6. # True for broken symbolic links.
  7. # if override and os.path.lexists(link_name):
  8. # os.remove(link_name)
  9. os.symlink(source, link_name)