next | previous | forward | backward | up | top | index | toc | Macaulay2 website
Macaulay2Doc :: relativizeFilename

relativizeFilename -- relativize a file name



i1 : relativizeFilename("a/b/","a/b/c/d")

o1 = c/d
i2 : relativizeFilename("a/b/c/d","a/b/")

o2 = ../../
i3 : relativizeFilename("a/b/c/d","a/b/e/f")

o3 = ../../e/f

Paths of the form foo/x/../bar, are shortened to foo/bar without checking the file system to see whether x is a symbolic link. For the other behavior, see realpath.

See also

For the programmer

The object relativizeFilename is a compiled function.