• Post Reply Bookmark Topic Watch Topic
  • New Topic

Concept of Symbolic Link  RSS feed

 
Ranch Hand
Posts: 226
Eclipse IDE Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Directly from this java oracle tutorial:

A symbolic link is a special file that serves as a reference to another file. For the most part, symbolic links are transparent to applications, and operations on symbolic links are automatically redirected to the target of the link. (The file or directory being pointed to is called the target of the link.) Exceptions are when a symbolic link is deleted, or renamed in which case the link itself is deleted, or renamed and not the target of the link.


Isn't just a simple link? a mean the link that usually we have on the Desktop are symbolik links right?
If yes, what would an hard link be then?

Thanks in advance.
 
Ranch Hand
Posts: 334
2
Java Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nick,

The symbolic vs. hard link is a unix concept that I don't believe other OSs like Windows implement. See http://www.cyberciti.biz/tips/understanding-unixlinux-symbolic-soft-and-hard-links.html

Essentially a symbolic link uses the path to the file and requires another directory lookup to resolve. A hard link points directly to the data on disk and can't a) point to a directory or b) cross filesystems.

Joe
 
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, Windows does have symbolic links just like Unix-like operating systems have (and I'm not talking about .lnk files). You can create links with the "mklink" command in a command prompt window. (I've only discovered this myself not very long ago).
 
Joe Areeda
Ranch Hand
Posts: 334
2
Java Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesper de Jong wrote:Actually, Windows does have symbolic links just like Unix-like operating systems have (and I'm not talking about .lnk files). You can create links with the "mklink" command in a command prompt window. (I've only discovered this myself not very long ago).


Jesper,
I'm not very familiar with Windows Internals. Is there a hard link concept in Windows? (that's what I meant to question) Can a file have 2 directory entries?

Joe
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Joe, here's some info on hard links, symbolic links, shortcuts (.LNK files) and junctions in Windows: http://devtidbits.com/2009/09/07/windows-file-junctions-symbolic-links-and-hard-links/
 
Joe Areeda
Ranch Hand
Posts: 334
2
Java Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Jesper!
 
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joe Areeda wrote:I'm not very familiar with Windows Internals. Is there a hard link concept in Windows? (that's what I meant to question) Can a file have 2 directory entries?

Me neither, but one thing that's worth remembering is that Windows file systems are very different from Unix ones (just one of the reasons that defrags are virtually non-existant on Unix). As I recall (unless things have changed) ALL "files" on a Unix fs are actually hard links - ie, the file itself and a hard link to it are structured exactly the same way; both are simply pointers to an inode to the actual data, which is why they are often referred to as 'aliases'.

However, I'm not sure whether any of this is very helpful, since we don't know why you want to know this. Is there some specific requirement you have, or is it just idle curiosity? If it is, that's fine; I just wondered.

Winston
 
Rancher
Posts: 999
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

You can create links with the "mklink" command in a command prompt window.


The command prompt of Windows XP does not recognize this command.
 
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ivan Jozsef Balazs wrote:

You can create links with the "mklink" command in a command prompt window.


The command prompt of Windows XP does not recognize this command.

The quoted article says it was introduced in Vista (and remains in Win 7 and 8). It also says the same ability was there since Win 2000, but that the method of doing it changed for each version of Windows, so it might be hard to find precisely how to do it for XP.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!