Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Absolute vs. Relative Symbolic Links (Symlinks)

Status
Not open for further replies.

Spab23

Programmer
Jul 22, 2003
43
CA
I use symlinks a lot on my system and I was wondering if there are any differences between using absolute vs. relative symlinks. Does one take longer to access?

Example: I have a file with a full path of:

/var/code/release/v1.0/jarFile.jar

and I want to symlink it to:

/var/code/server/jars/jarFile.jar

Should I create the symlink to be:

/var/code/server/jars/jarFile.jar -> ../../release/v1.0/jarFile.jar

or

/var/code/server/jars/jarFile.jar -> /var/code/release/v1.0/jarFile.jar

...or does it matter?
 
Conversely, if you make it an absolute link and move the whole directory tree to another location (probably by mounting a filesystem somewhere else), it will also break it, so you need to decide which is best for you.

If it is an application that may be deployed on other people's machines it may be best to use relative in case they decide to install it in a different location.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top