Hard links vs. shortcuts

Discussion & Support for xplorer² professional

Moderators: fgagnon, nikos, Site Mods

BRX
Silver Member
Silver Member
Posts: 304
Joined: 2002 Feb 08, 12:12

Post by BRX »

narayan wrote:Each shortcut occupies 100-400 bytes. Considering how many shortcuts we actually use, the overall size would be negligible.
True of course. I realize I was rather comparing to copying the files and not the shortcuts. Nonetheless there are still advantages of the hardlinks IMHO. For instance I don't know a way for creating recursive shortcuts. Also you can handle it like a file (for instance browse the content with quickview or viewer), it doesn't jump to the origin folder if executed and so on.

If the destination is on another partition then you need a shortcut. But I can't see a reason to use a shortcut (apart from simply starting of programs from desktop etc., that's not for hardlinks of course) over a hardlink for the same partition.
pj
Gold Member
Gold Member
Posts: 471
Joined: 2006 Jan 26, 14:01
Location: Florida

Post by pj »

narayan wrote:x2 has a "stock" column called "links'. Activate it (using ALT+K command) (details view only). Now you will see how many links the item has. By default, each file starts its life with 1 link. When you add a hard link to it anywhere (on the same NTFS disk), the count goes up.

When you see only 1 link in the column, that's the last copy.

I just noticed that the User Manual does not cover any of this (including the warning that deleting the last hard link will delete the item itself). I will add it.
I was unable to get the Links number to be greater than one when I tried to create a hard link to a file on an NTFS server I access.  

1. Selected the file in folder A using ctrl-C.  
2. Navigated to folder B.  
3. Right-click'd on blank area, selected Paste Special > Hard Link.
4. Item created in folder B. In folder B, Links = 1
5. Navigated back to folder A. Links = 1 for this file.

Am I missing something?

----------------------------

PJ in (sunny) FL
User avatar
nikos
Site Admin
Site Admin
Posts: 15771
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

are the files really hard-linked? Try modifying the one and see if the other one follows suit
pj
Gold Member
Gold Member
Posts: 471
Joined: 2006 Jan 26, 14:01
Location: Florida

Post by pj »

I didn't try that with the first files as they were reference (.PDF) files.  

The file I just tried was indeed hard-linked.  Edited the file in folder B, file in folder A changed.  Links still at 1 in both folders.

-------------------------------
PJ in (sunny) FL
User avatar
nikos
Site Admin
Site Admin
Posts: 15771
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

this column works for me both for vista and xp, so :shrug:

ps will a reboot help updating the link count?
pj
Gold Member
Gold Member
Posts: 471
Joined: 2006 Jan 26, 14:01
Location: Florida

Post by pj »

Nope.  Running XP Professional SP2.

No worries, just puzzled.
PJ in (sunny) FL

"The hardest thing to admit is what you don't know"
User avatar
johngalt
Gold Member
Gold Member
Posts: 559
Joined: 2008 Feb 10, 19:41
Location: 3rd Rock
Contact:

Post by johngalt »

Hmm, I verified that links column shows correct number in Vista Ultimate SP1 32bit.

I run multiple versions of Fx, SeaMonkey, Flock, and other browsers for testing, and I hate having to manually create my NoScript White list files over and over.  Using the hardlinks, I created 5 separate dirs for each install / version / type of browser, saved the whitelist from one version, then hard linked it to the other 4 folders.  X2 now shows 5 hardlinks for that whitelist file.  Now, I can simply export the current version from whichever browser and all are updated - time to implement this for bookmarks, history, basically any files that I want to share between browsers....

Thanks for bringing this topic up - I had read about HLs before but never tried them, and now I see *just* how robust they really are....
Image

Image
User avatar
nikos
Site Admin
Site Admin
Posts: 15771
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

just keep in mind that some editors manage to destroy hard links when saving a file. Notepad or editor2 are fine but developer studio foobars link relationships. The link count column will alert you when this happens
User avatar
johngalt
Gold Member
Gold Member
Posts: 559
Joined: 2008 Feb 10, 19:41
Location: 3rd Rock
Contact:

Post by johngalt »

Thanks for the info - I'll keep an eye out just in case any of the Fx extensions I have do the same thing, so I can report it to the extension developer(s).
Image

Image
Alan.B
Member
Member
Posts: 21
Joined: 2007 Sep 28, 15:46

Post by Alan.B »

Re breaking of Links when a file path changes.

Services "Distributed Link Tracking Client" is probably relevant.

By default XP has this active, and it is supposed to allow communal resources on a server to be shifted around, and the clients automatically follow and retain access.

I have followed Acronis advice and disabled it.
I generally do not need it,
and it is a massive burden / delay / conflict when Acronis is preparing to create a disk image archive file.

Regards
Alan
Post Reply