Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get actual path symlink is pointing to

Tags:

symlink

rust

Given a symlink, I want to know to which directory this symlink is pointing. Does the Rust standard library offer something to find this out? I have only found unstable API functions so far.

like image 932
nein. Avatar asked Dec 08 '22 01:12

nein.


1 Answers

It seems to me that you want fs::read_link:

Reads a symbolic link, returning the file that the link points to.

like image 64
Renato Zannon Avatar answered Jan 05 '23 15:01

Renato Zannon