Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Confusion on file paths

Quote Reply
Confusion on file paths
Alex,

When creating file paths, it's easier in the code to manually place the '/' rather than having it attached to one of the variables.

It makes working with templates and such easier.

Specifically, I'm looking at the
Code:
<a class="link" href="<%build_root_url%>/Detailed/<%detailed_url%>"><%Title%></a></B></FONT>

in the link.html file.

The use of /Detailed/ is very clear, separating the path URL and the file name, but if you look, <%detailed_url%> contains a leading slash. While it doesn't hurt anything, it doesn't need to be there, and it makes using that variable much harder.

It's really a good idea to *not* include trailing slashes and leading slashes inside variables and let the programmer be responsible for keeping track of it.

It makes the code easier to read and understand, and more consistent.

Thanks!
Subject Author Views Date
Thread Confusion on file paths pugdog 2518 Jul 16, 1999, 6:16 PM
Post Re: Confusion on file paths
Alex 2443 Jul 19, 1999, 9:45 PM
Post Re: Confusion on file paths
pugdog 2438 Jul 19, 1999, 9:58 PM