Symlinks

Moderators: Gully, peteru

Post Reply
User avatar
simoncasey
Wizard
Posts: 1761
Joined: Sun Apr 19, 2009 08:10
Location: Melbourne

Symlinks

Post by simoncasey » Tue Oct 20, 2015 15:42

I've worked out how to create a symlink on the T3 to my NAS using file commander. Is there anyway to specify a different name for the link either as part of creating the link or by editing the link afterwards. I realise I can do that by telnet but I wanted to show somebody how to do it using the UI.
Beyonwiz T4

prl
Wizard God
Posts: 32712
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: Symlinks

Post by prl » Tue Oct 20, 2015 15:50

simoncasey wrote:I've worked out how to create a symlink on the T3 to my NAS using file commander. Is there anyway to specify a different name for the link either as part of creating the link or by editing the link afterwards. I realise I can do that by telnet but I wanted to show somebody how to do it using the UI.
You can almost certainly rename the link in the same way you can rename a file (but I haven't actually tried that). If you want to give a different target to the link, you need to delete it and make a new one.

In commandline terms:

Code: Select all

ln -s x y # create a link called y that references x
mv y z # The link is now called z, but it still references x
There's no way to do

Code: Select all

ln -s x y # create a link called y that references x
rewritelink w y # You can't make y point at something else
You need to do:

Code: Select all

ln -s x y # create a link called y that references x
rm y # delete the link y
ln -s w y # create a link called y that references w
But all in the FileCommander, of course.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

User avatar
simoncasey
Wizard
Posts: 1761
Joined: Sun Apr 19, 2009 08:10
Location: Melbourne

Re: Symlinks

Post by simoncasey » Tue Oct 20, 2015 16:12

If i try to rename the sympink using the blue button in file commander I get an error
mv: can't rename xxxx : Not a directory
Beyonwiz T4

User avatar
peteru
Uber Wizard
Posts: 9741
Joined: Tue Jun 12, 2007 23:06
Location: Sydney, Australia
Contact:

Re: Symlinks

Post by peteru » Wed Oct 21, 2015 03:27

prl wrote:If you want to give a different target to the link, you need to delete it and make a new one.
You can change a symlink from the command line without having to use rm.

Code: Select all

ln -nsf target existing_link

"Beauty lies in the hands of the beer holder."
Blog.

User avatar
simoncasey
Wizard
Posts: 1761
Joined: Sun Apr 19, 2009 08:10
Location: Melbourne

Re: Symlinks

Post by simoncasey » Wed Oct 21, 2015 08:07

I found an easy solution to this and also what appears to be a bug in file commander.
What I was trying to do is use the UI to create a symlink to a directory on my NAS.
I created the link using file commander and then tried to rename it in file commander as the link is automatically given the same name as the destination folder
I get an error saying that it is not a directory, so it may not be checking the file type properly and assuming it is a directory and doing something specific (-r perhaps or ending the name with a /)

However, if I use the movie list I can rename the link without an error and all is good.
Beyonwiz T4

dRdoS7
Wizard
Posts: 1103
Joined: Tue Sep 22, 2015 11:47

Re: Symlinks

Post by dRdoS7 » Wed Oct 21, 2015 16:17

Hi,
simoncasey wrote:I found an easy solution to this and also what appears to be a bug in file commander.
You say: "bug", others say: "undocumented feature".

dRdoS7

Post Reply

Return to “Networking”