zenkalia wrote:can you explain this symlink thing better? the wiki is lacking, right now =[
Due to the fact that I didn't explain it at all, I'm confident I can explain it better. The question is: can I explain it well enough? I doubt it, but I'll give it a try.
----------
In Puppy the command line utility for making symlinks is a symlink called
ln.
I think ROX can make 'em, but I've not tried it. Midnight Command can make em also.
In my own words I'd describe symlink as a file which is an alias that points
to another file or directory. It is treated by the operating system and
programs as if it were the file.
Symlinks can be created in command line mode by a utility called ls.
If you type ln at the command prompt you will get this output:
- BusyBox v0.60.5 (2004.09.18-02:04+0000) multi-call binary
Usage: ln [OPTION] TARGET... LINK_NAME|DIRECTORY
Create a link named LINK_NAME or DIRECTORY to the specified TARGET
You may use '--' to indicate that all following arguments are non-options.
Options:
-s make symbolic links instead of hard links
-f remove existing destination files
-n no dereference symlinks - treat like normal file
-----------------
Symlinks are very common in Linux and the concept should be understood as
well as a practical howto make em.
Symlinks are used extensively in /lib, lets take a look at a few, as ls
displays them:
22 Aug 13 13:36 libnss_compat.so.2 -> libnss_compat-2.3.2.so
13980 Jun 14 2004 libnss_dns-2.3.2.so
13 13:36 libnss_dns.so.2 -> libnss_dns-2.3.2.so
34516 Jun 14 2004 libnss_files-2.3.2.so
Notice the ->
That is saying that the file is a link and points another file. In the case of
libnss_dns.so.2, if an application or routine wants to use
libnss_dns.so.2 it will find it and attempt to use it. In actual practice,
it will be using libnss_dns-2.3.2.so
Why do it this way? In the case of libraries, you don't need duplicate files.
libnss_dns-2.3.2.so is only 13 bytes but the libary it points to is 13980 bytes.
There are many, many other reasons to use symlinks.
Linux for example, has some standards for directory locations. /etc is an
important and standard directory. Puppy is a Linux distro that does
have a /etc directory, yet needs one.
So Barry made a symlink called /ect which actually points to a hidden directory
called /root/.etc
Linux works fine, because it looks for /etc and finds it and it's expected
contents, even thougn in reality it doesn't exist where it seems to be.
In the case of firefox on my computer, the operating system, menu, and other
applications cannot find it because they don't know where I put it.
Firefox is in /mnt/hda7/shared/firefox/firefox on my computer.
Linux will only look for executable file in the path statement, Defined in
/root/.etc/profile on the top line. Firefox is not located in these locations
and Linux cannot find it, because it is not going to look beyond the path
statement to find it.
If you want to see where Linux will look for executable files type this
command:
echo $PATH
On most Puppys the output is this:
/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin:/root/my-applications/bin
Suppose I want Puppy to find firefox without having it in the path. I make a
smylink as follows:
ln -s /mnt/hda7/shared/firefox/firefox /root/my-applications/bin/
After doing this Puppy will find the symlink called firefox, which is located
in /root/my-applications/bin, which is in the path and Puppy will run it where it is
actually located in /root/my-applications/bin even though it is not.