Project

General

Profile

Feature #18925

Updated by nobu (Nobuyoshi Nakada) over 2 years ago

Usual `File.symlink` (and `ln -s`) creates a symbolic link as the given argument. 
 GNU coreutils `ln` `ls` has `-r` (`--relative`) option, which resolves the source path relative to the current directory as relative to the link location. 

 ```shell-session 
 $ mkdir src dest 
 $ echo ok > src/x 
 $ ln -s src/x dest 
 $ readlink dest/x  
 src/x 
 $ cat dest/x 
 cat: dest/x: No such file or directory 
 $ rm dest/x 
 $ ln -sr src/x dest 
 $ readlink dest/x  
 ../src/x 
 $ cat dest/x  
 ok 
 ``` 

Back