Lines Matching refs:path
8 # Find the best reverse path to reference the current directory from another
12 # If the directory is given as an absolute path, return an absolute path to the
15 # If there's a symlink involved, and the same relative path would not work if
17 # path. This handles paths like out -> /mnt/ssd/out
19 # For symlinks that can use the same relative path (out -> out.1), just return
20 # the relative path. That way out.1 can be renamed as long as the symlink is
23 # For everything else, just return the relative path. That allows the source and
26 def reverse_path(path):
27 if path.startswith("/"):
28 return os.path.abspath('.')
30 realpath = os.path.relpath(os.path.realpath('.'), os.path.realpath(path))
31 relpath = os.path.relpath('.', path)
34 return os.path.abspath('.')