Page 1 of 1

Understand Symbolic link-Hard-link-Junction

Posted: 12 May 2013 06:09
by binocular222
From http://msdn.microsoft.com/en-us/library ... s.85).aspx
I understand that:
 Symbolic links: Link appear as though the file/folder actually exists at the location of the symbolic link (i.e files show same extension; file size, attribute…). All applications won’t know any different.
 Hard link: Symbolic links for file on same drive (volume).
 Junction (aka soft link): Symbolic links for directory (folder).
-------------------------
So, I can use Paste Special → Paste symbolic link (#270) in all cases, why I need to paste hard link or junction at all?
in List, symbolic links to file show file size = 0 while junctions show actual size of target. Is this intended?

Re: Understand Symbolic link-Hard-link-Junction

Posted: 14 May 2013 05:53
by xman
I messed with this a few years back in one of my projects.

Symbolic links work only on Windows Vista and newer. They are generally preferable to other types, but on Win XP, you need to use junctions or hardlinks.

Both symbolic links and junctions don't update when their target is removed/renamed or when drive letter is changed. Instead, it seems that a new empty file is created when accessing such link. Hardlinks don't suffer from this and all copies always point to the right file and you can move and rename them however you like (at least as long as they are on one partition).

Symbolic links, unlike other types (I believe) support relative path, but not when created by XYplorer.

Re: Understand Symbolic link-Hard-link-Junction

Posted: 14 May 2013 06:17
by binocular222
Oh, thanks.
Seems that these features is not much useful due to their fragility

Re: Understand Symbolic link-Hard-link-Junction

Posted: 17 Feb 2015 14:12
by binocular222
How to edit symbolic link within XY?
I'm about to use relative path in symblink.

Re: Understand Symbolic link-Hard-link-Junction

Posted: 17 Feb 2015 15:12
by TheQwerty
binocular222 wrote:How to edit symbolic link within XY?
I'm about to use relative path in symblink.
Currently this doesn't seem possible (and even difficult outside of XY).

A lot of suggestions seem to point users to the Link Shell Extension but I have no experience with it and thus cannot offer any guidance.

Re: Understand Symbolic link-Hard-link-Junction

Posted: 17 Feb 2015 15:17
by binocular222
Windows Vista+ has native mklink cmd command to create symlink.
I sucessfully created a relative one such as:
::run "cmd /c mklink /d ""<xyscripts>\theme\xxx"" ""..\Other"""
the xxx symblink correctly resolved to <xyscripts>\Other
But ::echo <prop #JunctionTarget>
show empty
a bug?

Another note:
XY can delete the xxx symlink file correctly (not delete souce)
but on copy/move (CtrlC/Ctrl X - Ctrl V), the source is moved instead of the symlink file

P.S This simple script edit current symlink file by delete old one then recreate

Code: Select all

	$CurItem = "<curitem>";
	$NewLink = input("Edit symblink",, <prop #JunctionTarget>);
	delete ;
	run "cmd /c mklink /d ""$CurItem"" ""$NewLink"""