next | previous | forward | backward | up | top | index | toc | directory | Macaulay 2 web site
Macaulay2Doc > The Macaulay 2 language > file manipulation > realpath

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

Synopsis

Description

i1 : realpath "."

o1 = /builddir/build/BUILD/Macaulay2-1.2/Macaulay2/packages/Macaulay2Doc-
     temporary
i2 : p = temporaryFileName()

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

o3 = /tmp/M2-18658-2
i4 : symlinkFile(p,q)
i5 : p << close

o5 = /tmp/M2-18658-1

o5 : File
i6 : readlink q

o6 = /tmp/M2-18658-1
i7 : realpath q

o7 = /tmp/M2-18658-1
i8 : removeFile p
i9 : removeFile q

Caveat

Every component of the path must exist in the file system and be accessible to the user. Terminal slashes will be dropped.

See also