Puppy Linux Discussion Forum
"THE" alternative forum : puppylinux.info

 The time now is Tue 30 Sep 2014, 12:45 All times are UTC - 4
 Page 1 of 2 [20 Posts] Goto page: 1, 2 Next
Author Message
ssreddy

Joined: 12 Jun 2013
Posts: 43

 Posted: Fri 14 Jun 2013, 07:46    Post subject:  What's the difference between a relative & absolute Link?

What's the difference between a relative & absolute Link?
Semme

Joined: 07 Aug 2011
Posts: 3928
Location: World_Hub

 Posted: Fri 14 Jun 2013, 07:53    Post subject:

Relative links are essentially shortcuts. Does this page clarify it for you?
ssreddy

Joined: 12 Jun 2013
Posts: 43

 Posted: Fri 14 Jun 2013, 08:10    Post subject:

 Semme wrote: Relative links are essentially shortcuts. Does this page clarify it for you?

Yes, sir.

This makes things abundantly clear.

Thanks a lot.
Semme

Joined: 07 Aug 2011
Posts: 3928
Location: World_Hub

 Posted: Fri 14 Jun 2013, 08:13    Post subject:

Good. Now let's wrap up Osmo.
amigo

Joined: 02 Apr 2007
Posts: 2251

 Posted: Fri 14 Jun 2013, 09:13    Post subject:

Sorry, but that page is simply wrong. There are four terms that are used:
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)
Burn_IT

Joined: 12 Aug 2006
Posts: 1011
Location: Tamworth UK

 Posted: Fri 14 Jun 2013, 10:57    Post subject:

Just to confirm, Amigo is perfectly correct.
_________________
I can't remember the last time I forgot something!
DaveS

Joined: 09 Oct 2008
Posts: 3726
Location: UK

 Posted: Fri 14 Jun 2013, 11:35    Post subject:

I often wondered why there should be two options. I understand what they are, but not why they exist......
_________________
Spup Frugal HD and USB
Root forever!
ssreddy

Joined: 12 Jun 2013
Posts: 43

 Posted: Fri 14 Jun 2013, 11:38    Post subject:

 DaveS wrote: I often wondered why there should be two options. I understand what they are, but not why they exist......

Yes, indeed!

Why not show the entire path always to make things clear?
Burn_IT

Joined: 12 Aug 2006
Posts: 1011
Location: Tamworth UK

 Posted: Fri 14 Jun 2013, 12:30    Post subject:

For the reason you may not know the full path when you start to search.

Then having displayed the files at a particular level you would be extremely cross if you had to keep on typing all the lower levels.

_________________
I can't remember the last time I forgot something!
nooby

Joined: 29 Jun 2008
Posts: 10557
Location: SwedenEurope

 Posted: Fri 14 Jun 2013, 15:55    Post subject:

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

_________________
I use Google Search on Puppy Forum
not an ideal solution though
Burn_IT

Joined: 12 Aug 2006
Posts: 1011
Location: Tamworth UK

 Posted: Fri 14 Jun 2013, 17:02    Post subject:

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)

_________________
I can't remember the last time I forgot something!
nooby

Joined: 29 Jun 2008
Posts: 10557
Location: SwedenEurope

 Posted: Fri 14 Jun 2013, 23:30    Post subject:

I don't remember which puppy but one or two of them
rename /mnt/home7 that way. It is not me doing it

Should I prefer the Absolute or the Relative at such times?

_________________
I use Google Search on Puppy Forum
not an ideal solution though
ssreddy

Joined: 12 Jun 2013
Posts: 43

 Posted: Sat 15 Jun 2013, 01:41    Post subject:

 Burn_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)

If we want to make a relative path for /mnt/home, can we write it as
./home? Like wise, for /mnt/home/x1/x2, will the relative path be
.../x2?
Burn_IT

Joined: 12 Aug 2006
Posts: 1011
Location: Tamworth UK

 Posted: Sat 15 Jun 2013, 06:49    Post subject:

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:

 Code: 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

_________________
I can't remember the last time I forgot something!
ssreddy

Joined: 12 Jun 2013
Posts: 43

 Posted: Sat 15 Jun 2013, 08:36    Post subject:

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?
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year  Sort by: Post TimePost SubjectAuthor AscendingDescending
 Page 1 of 2 [20 Posts] Goto page: 1, 2 Next
 Jump to: Select a forum ------------------- Forum index |___ House Training |   |___ Beginners Help ( Start Here) |   |___ Users ( For the regulars ) |   |   |___ Usuarios de habla Hispana |   |   |___ Für deutschsprachige Anhänger |   |   |___ Pour les francophones |   |     |   |___ HOWTO ( Solutions ) |   |___ Bugs ( Submit bugs ) |     |___ Advanced Topics |   |___ Additional Software (PETs, n' stuff) |   |   |___ Package Collections / Repositories |   |   |___ REQUESTS |   |   |___ Browsers and Internet |   |   |___ Business |   |   |___ Compiling |   |   |___ Desktop |   |   |___ Documents |   |   |___ Drivers |   |   |___ Educational |   |   |___ Engineering/Science/Simulation |   |   |___ Eye Candy |   |   |___ Filesystem |   |   |___ Games |   |   |___ Graphics |   |   |___ Multimedia |   |   |___ Network |   |   |___ Security/Privacy |   |   |___ System |   |   |___ Utilities |   |   |___ Virtualization |   |   |___ Unsorted |   |     |   |___ Cutting edge |   |   |___ Multi-session live-CD/DVD |   |     |   |___ Hardware |   |   |___ Audio |   |   |___ Networking |   |   |   |___ Dialup |   |   |   |___ Ethernet |   |   |   |___ Wireless |   |   |     |   |   |___ Printers |   |   |___ Video |   |     |   |___ Puppy Derivatives |   |___ Puppy Projects |       |___ Next Puppy Development |       |   |___ 4.x |       |   |   |___ Bugs (4.x dev) |       |   |   |___ Usability Issues (4.x dev) |       |   |     |       |   |___ 5.x |       |       |___ Bugs (5.x dev) |       |       |___ Usability Issues (5.x dev) |       |     |       |___ Localization Project |       |___ Documentation Project |     |___ Taking the Puppy out for a walk |   |___ Announcements |   |___ Puppy Power |   |___ Suggestions |   |___ Misc |     |___ Off-Topic Area     |___ Programming     |___ Security

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum