C ++ equivalent to 'readlink -f'

In unistd.h, I have a C function readlinkthat follows a link down one goal. Coreutil readlinkhas an excellent option -ffor recursively following each symbolic link. How can I get this behavior in C ++? Acceleration library, posix function that I don't know about, etc.?

** Edit ** just looked at the man page realpath. Does this give the same "canonical" decomposition readlink -f?

+3
source share
1 answer

Yes, it realpathis equivalent readlink -f.

See the man page for more details .

+2
source

All Articles