brandt / symlinks

symbolic link maintenance utility
MIT License
125 stars 24 forks source link

shorten path seems not to work on levels more than 2 subdirs deep #6

Open LandisTwo opened 5 years ago

LandisTwo commented 5 years ago

Nice util, for shallow directory structure. But, when I use on a sub directory more than 4 levels deeper than /, Symlinks only drops the 2 or 3 directories above working directory. example: /home/user/Media/4TBackup/videos/Auto/WorkingDir/symlink-files.ext symlink-files.ext links to /home/user/Media/4TBackup/videos/Auto/OriginalDir/original-files.ext Symlinks Util, using # symlinks -rcsov only shortens link path to: /home/user/Media/OriginalDir/symlink-files.ext, dropping only 2 or 3 directories exp: /4TBackup/videos/Auto/

Also, will not change any dangling symlink (0 byte). It would be nice if it did, as it may only be 'dangling' because it was moved from /old-vol/dir/sub-dir1 to /new-vol/dir/sub2, and with the destination file actually residing in /dir/sub-dir0/ it would work being changed to ../sub-dir0 even though it's currently 0 byte.

Again, Symlinks works great when directories are only 1 or 2 directories below my user's home directory: eg /home/user/working/file.ext linked to /home/user/tmp/file.ext resulting in correct shortened path of: ../file.ext

Thanks, Landis.

LandisTwo commented 5 years ago

p.s. I've tried while in the 'link directory', the source directory using full path from /home/user directory, and being in the highest 'common' (parent) directory of both source and symlink, but No. Symlink still drops 3 directories from symlink's path. : (