next | previous | forward | backward | up | top | index | toc | home
Macaulay2 > The Macaulay2 language > file manipulation > realpath

realpath -- convert a filename to one passing through no symbolic links

Synopsis

Description

i1 : realpath "."

o1 = /home/dan/src/M2/BUILD/normal/Macaulay2/packages
i2 : p = temporaryFileName()

o2 = /tmp/M2-29528-1
i3 : q = temporaryFileName()

o3 = /tmp/M2-29528-2
i4 : symlinkFile(p,q)
i5 : readlink q

o5 = /tmp/M2-29528-1
i6 : realpath q

o6 = /tmp/M2-29528-2
i7 : p << "hi there" << close

o7 = /tmp/M2-29528-1

o7 : File
i8 : realpath q

o8 = /tmp/M2-29528-1

Caveat

Links going nowhere are not traversed, as the example shows.

See also