What's the difference between a relative & absolute Link?
What's the difference between a relative & absolute Link?
Sorry for bothering u about this basic question.
What's the difference between a relative & absolute Link?
What's the difference between a relative & absolute Link?
Sorry, but that page is simply wrong. There are four terms that are used:
hard link
symbolic link (sometimes called soft)
relative link (actually relative path)
absolute link (actually absolute path)
hard links are hardly ever used and you must understand a bit about filesystems to know about them. symbolic links are created using the '-s' option to the 'ln' tool. When you use 'rm' on a symbolic link, the link is removed and not the object it points to.
relative and absolute refer to the *path* to the linked (real) object.
An absolute path always begins with '/' and fully describes the path to the object as viewed from the root of the filesystem '/'. A relative path describes the location of the object from the perspective of the 'current working directory'.
A relative link either starts with no '/', or starts with either './' or '../filename' (where there can any number of ../ or similar constructs)
hard link
symbolic link (sometimes called soft)
relative link (actually relative path)
absolute link (actually absolute path)
hard links are hardly ever used and you must understand a bit about filesystems to know about them. symbolic links are created using the '-s' option to the 'ln' tool. When you use 'rm' on a symbolic link, the link is removed and not the object it points to.
relative and absolute refer to the *path* to the linked (real) object.
An absolute path always begins with '/' and fully describes the path to the object as viewed from the root of the filesystem '/'. A relative path describes the location of the object from the perspective of the 'current working directory'.
A relative link either starts with no '/', or starts with either './' or '../filename' (where there can any number of ../ or similar constructs)
When I drag the .mozilla over to /mnt/home/ on some puppies
that location has the name /dev-save/sda1/ or some similar to me
unusual name. I think I make them absoiute just in case it is needed
would it be better to always make them relative? I feel so lost so I ask you guys
that location has the name /dev-save/sda1/ or some similar to me
unusual name. I think I make them absoiute just in case it is needed
would it be better to always make them relative? I feel so lost so I ask you guys
I use Google Search on Puppy Forum
not an ideal solution though
not an ideal solution though
I believe that in the case you just mentioned the locations are exactly the same, but have been referred to by different names.
/mnt/home is a logical name within Puppy that translates to the physical location /dev-save/sda1/.
Do you say that you are going home, or do you say I you are going to No 6. Parkfield Road, Anytown. This Country. (If that is where you lived)
/mnt/home is a logical name within Puppy that translates to the physical location /dev-save/sda1/.
Do you say that you are going home, or do you say I you are going to No 6. Parkfield Road, Anytown. This Country. (If that is where you lived)
"Just think of it as leaving early to avoid the rush" - T Pratchett
If we want to make a relative path for /mnt/home, can we write it asBurn_IT wrote:I believe that in the case you just mentioned the locations are exactly the same, but have been referred to by different names.
/mnt/home is a logical name within Puppy that translates to the physical location /dev-save/sda1/.
Do you say that you are going home, or do you say I you are going to No 6. Parkfield Road, Anytown. This Country. (If that is where you lived)
./home? Like wise, for /mnt/home/x1/x2, will the relative path be
.../x2?
Introducing the dots into the location confuses the situation somewhat and can be confusing if you are not fully aware of how they work.
I've just tried looking up the rules and the best I could find is a Windows example ,but it is the same in Puppy:
I've just tried looking up the rules and the best I could find is a Windows example ,but it is the same in Puppy:
Code: Select all
Dots and dot-dots
There are two special folder names that you can use in relative paths:
One dot (.) always refers to the current folder.
Two dots (..) refers to the folder that is one level higher than the current folder.
For example:
The relative path to a program named foo.exe in a folder two levels above the current folder is:
..\..\foo.exe
The relative path to a folder named Images in a folder three levels above the current folder is:
..\..\..\Images
The relative path to a file named whatsup.doc in the current folder can either be written as:
whatsup.doc
or as:
.\whatsup.doc
"Just think of it as leaving early to avoid the rush" - T Pratchett
Thanks.
But, in such a case, how to know what are the higher level folders just from dots? In other words, without knowing the hierarchy, how to know where the file is located from the path? (of course, there are other ways to find it).
I notice, In windows, they use absolute paths more often than not, don't they?
But, in such a case, how to know what are the higher level folders just from dots? In other words, without knowing the hierarchy, how to know where the file is located from the path? (of course, there are other ways to find it).
I notice, In windows, they use absolute paths more often than not, don't they?
It very much depends on the circumstances.I notice, In windows, they use absolute paths more often than not, don't they?
I always use absolute paths on my own machine because I know the file name structure. If you are writing scripts for other people to use then it is far better to use relative paths because you have no idea where the script is being run from.
"Just think of it as leaving early to avoid the rush" - T Pratchett
"use relative paths because you have no idea where the script is being run from" This is exactly backwards. Use relative links when you *do* know the files layout and you know where the link is gonna be -or when it does not matter.
Usually, one will use both types according to the situation. An example of where relative paths are useful is with AppDirs, bundles, apps or application Directories -where everything (extra) an application needs is located under a single directory. The concept usually includes the fact that the app can be placed anywhere on your system -so-called 'run-from-anywhere'. Here any links which refer to objects under the AppDir should use relative paths. Any links to system objects should use absolute paths -although most scripts let the users' PATH be searched for any system binaries. A relative link may begin with '../', './' or with just a file or directory path *as seen from the directory where the link is located*.
Usually, one will use both types according to the situation. An example of where relative paths are useful is with AppDirs, bundles, apps or application Directories -where everything (extra) an application needs is located under a single directory. The concept usually includes the fact that the app can be placed anywhere on your system -so-called 'run-from-anywhere'. Here any links which refer to objects under the AppDir should use relative paths. Any links to system objects should use absolute paths -although most scripts let the users' PATH be searched for any system binaries. A relative link may begin with '../', './' or with just a file or directory path *as seen from the directory where the link is located*.