NTLinks + NTLinksMaker: NTFS links creation and information

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

NTLinks + NTLinksMaker: NTFS links creation and information

Post by *MVV »

I had wrote my own plugin for NTFS hardlinks and reparse points, it correctly processes symbolic links for files/folders and also has field for file index (useful for searching all hardlinks of particular file).

Also tool for NTFS links creation was finally released!

Last version information

Version no: 1.6 32/64
URL: NTLinks at wincmd.ru / NTLinks at totalcmd.net

Version no: 1.4 32/64
URL: NTLinksMaker at wincmd.ru / NTLinksMaker at totalcmd.net

Requirements: operating system Windows 2000 and above, Total Commander :)


NTLinks features:

+ gets file indexes and number and paths of hardlinks
+ gets target path for reparse points and real path for all objects
+ supports symbolic links (new in Windows Vista/7)
+ get/set target path for symbolic links and junctions
+ fastest hardlinks comparison (within same volume)
+ Unicode and long paths support

NTLinksMaker features:

+ supports junctions, hardlinks, absolute/relative symbolic links
+ allows duplicating first levels with regular folders
+ allows keeping directory structure (for objects from multiple dirs)
+ elevation request when admin rights needed
+ supports silent mode w/o any windows
+ Unicode and long paths support



NTLinks plugin provides following content fields:

HLNK_Count - returns hard copies number for file. Each copy has its place in some directory within one partition. Changing file's contents or attributes (incl. permissions) reflects on all its hard copies because they have common file contents.

HLNK_Index - returns string that represents 64-bit integer index of file, this index is unique within partition for each file. All hard copies will have the same index, and you may find all copies by specifying this index (or only part of it, because index returned as string).

Obj_Type - returns "Dir" for usual folder, "File" for usual file and some of reparse point type for reparse points. If type of reparse point can't be determined (i.e. because of permissions), value "RP: N/A" returned.

RP_Target - returns target file/folder/drive reparse point points to. For volume mount points it's a path to drive root, for symlink it is a path to file (relative or absolute), for symlinkD and junction it is a path to folder. For other reparse points currently no target return (if you have info about it - that's good). If you're running Windows NT5 (2000), admin rights are required to correctly resolve first mount point if volume has no letter assigned (current mount point path returned else - it is a valid mount point too). You may choose between natural and symbolic output mode - in symbolic mode volume names for mount points are not resolved to mounted path names.

RP_IsValid - returns Yes when target folder/file/drive of reparse point is available (for example, if it's a mount point of DVD drive, target will be valid when correct CD/DVD is inserted, for junctions/symlinks path is valid if target object don't moved/deleted) or No otherwise.

Obj_RealPath - returns real path of FS object, expanding all reparse points (max 256 expands to avoid endless loops). You may choose between natural and symbolic output mode, as for RP_Target field.

Obj_RealSize - returns real size of a file (in case of symbolic link).

HLNK_Paths - returns paths of first 10 hard copies of the file, if available (all or N-th one, requires Windows Vista).

You may choose between natural and symbolic output mode - in symbolic mode volume names for mount points are not resolved to mounted path names, also relative targets of symbolic links are left as is. Each field return Unicode string for TC 7.50 and newer, and ANSI string for old TC versions.
Last edited by MVV on 2019-07-10, 17:26 UTC, edited 47 times in total.
User avatar
Alextp
Power Member
Power Member
Posts: 2321
Joined: 2004-08-16, 22:35 UTC
Location: Russian Federation
Contact:

Post by *Alextp »

Do you put it to totalcmd.net?
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Alextp wrote:Do you put it to totalcmd.net?
Currently I had only finished its testing and trouble-correction (like one that mount point info function returns volune names in form "\??\Volume{e0b03d73-84f2-11de-bcf7-806e6f6e6963}" but GetVolumePathNamesForVolumeName function expects it in the form "\\?\Volume{e0b03d73-84f2-11de-bcf7-806e6f6e6963}" - I had wasted not one hour while understood why it returns error :?)...
So, currently this link is the one place where my plugin may be downloaded. If you like it, I'll think about putting it to totalcmd.net, wincmd.ru. Or to add some new reparse points detection (currently it gets targets for symlink, symlinkd, mount point, and junction).
User avatar
Alextp
Power Member
Power Member
Posts: 2321
Joined: 2004-08-16, 22:35 UTC
Location: Russian Federation
Contact:

Post by *Alextp »

Ok, thanks. Hope you ll fix that issues.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Alextp wrote:Ok, thanks. Hope you ll fix that issues.
Currently I have no issues to fix or add. :)
Plugin supports all NL_Info reparse points plus some new feafures - symlinks and file indexes. There only one field for object type - it returns values "File", "Dir" or some reparse point type acronym. If you need to hide "File" or "Dir" strings, you may edit lng-file.
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

@MVV Know of any reason that your plugin would fail to install on Win2K? Error:
Error loading plugin file!
The plugin probably needs some DLLs missing on your system.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Balderstrom wrote:@MVV Know of any reason that your plugin would fail to install on Win2K? Error:
Error loading plugin file!
The plugin probably needs some DLLs missing on your system.
That's sad. My dll contains only clear code and standard Windows API function calls from kernel32.dll and user32.dll and no more stuff like MFC/CRT. Perhaps in Win2K's kernel32.dll some used function is missing. I'll try to find and install Win2K onto VM in order to check out this issue (or you may send me your kernel32.dll privately).
Postkutscher
Power Member
Power Member
Posts: 556
Joined: 2006-04-01, 00:11 UTC

Post by *Postkutscher »

2MVV
To my knowledge GetVolumePathNamesForVolumeNameW makes the trouble here. It requires WinXP accordingly to MSDN.

http://www.techtalkz.com/microsoft-device-drivers/284040-usb-device-interface-2.html#post1123114


[added] interesting to know http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=349144
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Postkutscher wrote:2MVV
To my knowledge GetVolumePathNamesForVolumeNameW makes the trouble here. It requires WinXP accordingly to MSDN.

http://www.techtalkz.com/microsoft-device-drivers/284040-usb-device-interface-2.html#post1123114


[added] interesting to know http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=349144
Thanks, I didn't thought about such enumeration. Let me improve it:)


New version 1.0.0.30: http://files.wyw.ru/3873189 (CRC32: 3A948968)
Removed import GetVolumePathNamesForVolumeNameW (plz test it on W2K)
Added HSM2, DFSR reparse points detection (but I don't know where to see anything except junction, MP and symlinks :))
Last edited by MVV on 2009-08-28, 20:57 UTC, edited 1 time in total.
Postkutscher
Power Member
Power Member
Posts: 556
Joined: 2006-04-01, 00:11 UTC

Post by *Postkutscher »

Thanks, MVV , it seems to work under W2k now.
User avatar
Clo
Moderator
Moderator
Posts: 5731
Joined: 2003-12-02, 19:01 UTC
Location: Bordeaux, France
Contact:

Post by *Clo »

[mod]Messages split from http://ghisler.ch/board/viewtopic.php?p=182662#182662 and following.
Clo, moderator[/mod]
#31505 Traducteur Français de TC French translator Aide en Français Tutoriels Français English Tutorials
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Clo wrote:
Thanks!


If someone has any suggestions, post it please :)
Postkutscher
Power Member
Power Member
Posts: 556
Joined: 2006-04-01, 00:11 UTC

Post by *Postkutscher »

Docs, please :)
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Postkutscher wrote:Docs, please :)
Is it really necessary? All supported fields are visible in TC dialogs.


HLNK_Index - shows string that represents 64-bit integer index of file, this index is unique inside partition. So, all hard copies will have the same index, and you may find all copies by specifying this index (or only part of it, because index returned as string).
HLNK_Count - shows ammount of hard copies of file. Each copy has its place in some folder of drive, copy can't be situated on another partition. Changing file's contents or attributes (incl. permissions) reflects on all its hard copies because they have common file contents.
Obj_Type - returns "Dir" for usual folder, "File" for usual file and some of reparse point type for reparse points. If type of reparse point can't be determined, value "RP: N/A" returned.
RP_Target - shows target file/folder/drive reparse point points to. For volume mount points it's a path to drive root, for symlink it is a path to file (relative or absolute), for symlinkD and junction it is a path to folder. For other reparse points currently no target return (if you have info about it - that's good).
RP_IsValid - boolean value, returned 1/Yes/True when target folder/file/drive of reparse point is available (for example, if it's a mount point of DVD drive, target will be valid when correct CD/DVD is inserted, for junctions/symlinks path is valid if target object don't moved/deleted).

About reparse points types I can't say nothing (except mentioned above). :)
Postkutscher
Power Member
Power Member
Posts: 556
Joined: 2006-04-01, 00:11 UTC

Post by *Postkutscher »

Strictly speaking I would like to know about symlinks, they are the one not mentioned in NL_info docs ;)

The second thing...the validity of reparse points is dependent on permissions of TC`s user. All RPs where I have no access are marked as not valid.
Post Reply