abilouise: (Default)
[personal profile] abilouise
How many people were reading my journal when I was talking about getting the HTML book to learn how to edit my own fucken website? Anyway, I am working on day 5, which is learning how to use links. So you all will suffer the wrath of my learning.
Eh. Fuck learning. I just hit a concept in the book that is the first one, I swear, that she does not explain in a way that I can understand. If anyone wants to explain relative and absolute pathnames to me in terms I will understand, be my guest. There may be fabulous prizes!
In other news I baked rye bread tonight but it came out more crumby than I wanted or expected it to. Phoo. But it still tastes great with good butter. No sandwiches though I think. And anyway, I don't think I'll ever be able to bake rye bread the way I really want it to come out. My least favorite thing about living outside of the metro New York area. sigh...

Date: 6 Sep 2005 16:19 (UTC)
From: [identity profile] kilroi.livejournal.com
Don't know if anyone else has yet, but I'll give it a try:

Any file on a computer has a location.
Like, the file "myfile.html"
might be at

c:/windows/something/other/myfile.html
or maybe
/home/kilroi/apache/htdocs/myfile.html

Although what it might show up as is

htt p://www.kilroi.org/myfile.html


So, you have this file myfile.html in which you are putting your happy webpage (or whatever). And this file is in a specific place.

And within an html file you can make links to other files! this is the fun hyptertext part, right?

Ok, so to link to another file you have to type in where that other file is.

I'm going to keep going with
/home/kilroi/apache/htdocs/myfile.html

aka

htt p://www.kilroi.org/myfile.html

Let's say I want to link to:

/home/kilroi/apache/htdocs/cool-stuff/fun.html

which can be found on the web as

htt p://www.kilroi.org/cool-stuff/fun.html

Ok.

I can either link to it as:

< a href = " htt p://www.kilroi.org/cool-stuff/fun.html " >

or as:

< a href = " ../cool-stuff/fun.html " >

The first one is *absolute*. It links the entire pathname of the file you are trying to get to. This is what an absolute pathname is no matter what. It doesn't matter where you start out at, it will get you to the right file.

The second one is a *relative* pathname. It is relative to the file you started with. Ie, the ".." means "go to the directory above the directory I am in now"
(aka /home/kilroi/apache/htdocs/ or www.kilroi.org, depending on how you want to think of it)
and *then* go into the directory "cool-stuff" and then find the file "fun.html". A relative filename depends on where you are already; it shows the *relation* between the two files.

Does this help even a little? I'm a bad explainer and I always end up sounding like I'm talking to a 5 year old when I don't mean to be ....

anyway, hope it helps, or someone else explained it or something.

cheers.

Date: 6 Sep 2005 19:26 (UTC)
From: [identity profile] lena-a-mermaid.livejournal.com
Is it easier to bake rye bread when living in Metro New York than it is when living in Metro Boston? :-)

Date: 7 Sep 2005 03:46 (UTC)
From: [identity profile] 76trombones.livejournal.com
An absolute pathname is like saying "Bob Smith"; a relative pathname is like saying "my father's sister Jane's son Bob".

Er... darnit, now I feel like I'm in talking-to-five-year-old mode *and* I've made an unintentional pun. Um.

So, I think the problem is that I don't know whether you want the *concept* itself or you want to know more about how the mechanics match the concept. Not, mind you, that I'm sure I'd be able to explain it in any case!

Date: 7 Sep 2005 06:06 (UTC)
From: [identity profile] abilouise.livejournal.com
No, I bake bread that is equally mediocre (though not bad) no matter where I live. But in Metro New York I don't have to bake rye bread because I can buy the kind that I love at the store.

Date: 7 Sep 2005 06:09 (UTC)
From: [identity profile] abilouise.livejournal.com
I think that my blockage is actually more to do with *why* I would need to learn this and what it is useful for, rather than what it is, which is a fine point but the one that I mostly get stuck on. I remember learning math concepts in school and once I got it I would be totally homework-incapacitated with the issue of WHY would I ever *want* to know/be able to do this? It's a personal weirdness I think. Makes massage school and cooking and changing the tube on my bicycle easy but many other things hard.

Date: 7 Sep 2005 06:11 (UTC)
From: [identity profile] abilouise.livejournal.com
You didn't make me feel like you're talking to a 5-year-old and I think I get it but I don't get WHY one of these would be better than the other. It sort of seems like you shouldn't need both, but I can't really explain why it feels this way.

Date: 7 Sep 2005 06:12 (UTC)
From: [identity profile] abilouise.livejournal.com
Also, something I've been meaning to ask for a while: Do I know you? I can't figure out who you are if I do.

Date: 7 Sep 2005 06:26 (UTC)
From: [identity profile] kilroi.livejournal.com
I generally think of absolute pathnames being better, because they more clearly delineate where something is. In my above example, if I use an absolute pathname as a link, no matter where I put myfile.html, it will always link to the right place.
(Of course, if you move the file you link to, you have to fix the link).

However! Let's say you had a nice gorgeous webpage built up, lots of links to itself all over the place, &c., &c. And it's all at htt p://www.kilroi.org.
But www.kilroi.org expires, and I have to get www.kilroi.net
( or www.i-am-a-loser.net). Now pointing to kilroi.org is no good, and I would have to go back and change everything, but if the organization of my *files* hadn't changed, just the server, all the links would still be correct and you wouldn't have to change anything, if you had used relative links.

So, if you think the structure of stuff with respect to the other files you are linking to will stay static, relative stuff can be nifty. However, it is harder to fix, in my mind, if you move things around, whereas if you have the full (aka absolute) path it is a little easier to see if you are linking to things in the wrong place in your original html code.

Relative versus absolute stuff is used not only in html code - so , in regular code, if you were going to ship something where the code itself never gets touched, relative links might be easier and shorter to type, or something. I suspect that most of it just comes from the UNIX commandline and being able to say
cd ../../../blah to go up 3 levels, and get the file you want, without having to type in a full pathname

Date: 7 Sep 2005 12:13 (UTC)
From: [identity profile] 76trombones.livejournal.com
Ahh. Sounds like [livejournal.com profile] kilroi already said some of what I would say about why. I do have one other "why" point, which starts with "back in the day, web.mit.edu and www.mit.edu were actually different servers, and sometimes one would be down when the other was up." I need to run off right now, but I'll try to remember to write the rest of it!
Page generated 2 January 2026 16:28
Powered by Dreamwidth Studios