LDLink

Note: LDLink has been superseded by LDMerge.

LDLink is a utility that can reversibly combine separate LDraw part libraries by creating symbolic links to the contents of one directory structure in another. Alternate libraries can be used to manage unofficial LDraw parts; support for this concept is present to varying degrees in some LDraw programs. This utility is intended to facilitate other tools, such as L3P, which do not readily support parallel part libraries.

Download ldlink 1.0 (5k Tcl script)

Install the script as ldlink and make it executable with chmod +x ldlink.

Usage: ldlink merge|unmerge [-src LDRAWDIR] [-dst LDRAWDIR]
       On merge, links to src files are created in dst.
       On unmerge, links named after src files are removed from dst.
       Conflicts with normal files in dst are skipped and reported.
       Default dst is LDRAWDIR environment variable.
       Default src is dst/Unofficial.

To merge unofficial parts downloaded by LDView with the rest of your part library, the following command may be sufficient:

ldlink merge

If the environment variable LDRAWDIR is not defined — or if you would like to override its value — use the dst option to specify the destination where the merge should occur. Likewise, the src option may be used to merge parts from a source other than the destination’s Unofficial subdirectory:

ldlink merge -src /Custom/LDraw -dst /Standard/LDraw

To reverse a merge, reissue the command using unmerge instead of merge:

ldlink unmerge
ldlink unmerge -src /Custom/LDraw -dst /Standard/LDraw

LDLink reports how many links it created or removed.

Posted on Tuesday, July 10th, 2007. Tags: .

4 Responses to “LDLink”

Posted by mikeheide on Tuesday, September 4th, 2007 at 2:59 PM.

Is this also possible for Windows Systems?

Posted by Jim on Tuesday, September 4th, 2007 at 4:59 PM.

Hypothetically, yes. You need Tcl, which is free; the ActiveTcl download should be easiest to install, although I’m not familiar with it. I don’t know which command line you would use with Windows, but this script should be platform independent.

However, Tcl’s file link documentation states that links are only supported in Windows NT/2000/XP, and that files are linked with hard links. Depending on the implementation, that might mean that the original files are deleted when the links are removed (which would not be good). I may be able to test this at some point; if so, I will update this page to clarify whether it works with Windows.

If not, there are other methods I could use (and perhaps should have used) that would be more portable.

Posted by Jim on Friday, September 7th, 2007 at 7:43 AM.

LDLink is not compatible with Windows. (More specifically, the FAT32 and NTFS file systems commonly used with Windows do not support the kind of symbolic links LDLink relies on.)

Therefore, the next version of LDLink will instead use some sort of index to identify files originating from different LDraw directories. In addition to being portable, this might permit more information about each file to be stored and utilized for new features.

I can’t say when that version will be available.

Posted by Anonymous on Friday, September 14th, 2007 at 5:36 AM.

Thank you very much for your explanations. That is also exactly what I thought. But I think as many people use Windows it would be a great thing to have such a tool also for Windows.