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
Dalai
Power Member
Power Member
Posts: 9386
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

2MVV
First, thank you very much for this really useful tool NTLinksMaker! Especially the feature to keep the directory structure (/r switch) came in handy the last few weeks :).

However, I've found a rather big bug. NTLinksMaker doesn't support paths longer than MAX_PATH (259) characters, and doesn't complain about them! So, the user may think that everything went OK while it's not. NTLinksMaker just quits the process without any hint whether it completed successfully. Even worse: all links following the problematic source file are not created, too.

How did I found that one? Well, I wanted to create hardlinks of over 100,000 files while keeping the directory structure. I started NTLinksMaker using the recommended parameter field string (/q- /b /r="%P" "@%WL" "%T") and wondered why it finished so fast and only one directory (with several subdirs) had been created. I tried it again, with the same result. So I searched through the source structure to find paths longer than MAX_PATH (it was just a wild guess that there might be paths like that) and found a couple of them, shortened them and successfully created all links afterwards.

That brings me to the next "issue" at hand: It would be really helpful to have some kind of dialog that notifies the user in any way that NTLinksMaker is doing something, at least if the process is going to take a while - which was the case in my case above. This can be some static text "Creating links" or something like that, but can be made even better with some progress, number of links created so far, etc.

Last, and actually the least: there's a copy'n'paste error in the English section of readme.txt of the current version: The part describing the Language in the .ini file contains Russian text.

Finally, here's my German translation. I don't know whether it's better than Peter's. I've translated it a while ago while I wasn't aware of any existing German translation.

Code: Select all

; NTLinksMaker 1.0.5.236, by Dalai

[NTLinks Maker]
; German messages (1252) - be careful with format parameters like "%s" and "%X"
1=&Ja
2=&Nein
3=&OK
4=&Abbrechen
5=Ja zu &allen
6=N&ein zu allen
7=Ignoriere &alle
8=Erzeuge &Link(s) für %d Objekt(e) als:
9=Anzahl der &Ebenen, die als Verzeichnis erzeugt werden sollen:
10=Fehler beim Erzeugen des Links:\n%s\n\nLinkziel:\n%s\n\nFehlerbeschreibung:\n
11=Die Erzeugung symbolischer Links benötigt Administratorrechte.
12=Ihr Windows unterstützt anscheinend keine symbolischen Links.\n\nSollen stattdessen Junctions (Abzweigungspunkte) & Hardlinks erzeugt werden?
13=Relative Pfade der Objekte erkennen, ausgehend von folgendem &Basispfad:
14=Zu erzeugender Linkt&yp:
15=Hardlinks und Junctions (Abzweigungspunkte)
16=Symbolische Links wenn notwendig
17=Nur symbolische Links
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Thank you for your response!
Dalai wrote:However, I've found a rather big bug. NTLinksMaker doesn't support paths longer than MAX_PATH (259) characters, and doesn't complain about them! So, the user may think that everything went OK while it's not. NTLinksMaker just quits the process without any hint whether it completed successfully. Even worse: all links following the problematic source file are not created, too.
Strange that it doesn't warn and stops processing, I'll try to investigate that...
Long paths are not supported, you're right, they require special handling. Perhaps I'll add support for them later (as I've already did it for Copy Tree plugin).
That brings me to the next "issue" at hand: It would be really helpful to have some kind of dialog that notifies the user in any way that NTLinksMaker is doing something, at least if the process is going to take a while - which was the case in my case above. This can be some static text "Creating links" or something like that, but can be made even better with some progress, number of links created so far, etc.
Wow, you found a task that lasts longer than multiple seconds. :D I'll put your wish into my TODO list.
Finally, here's my German translation. I don't know whether it's better than Peter's. I've translated it a while ago while I wasn't aware of any existing German translation.
Thank you for translation but I don't know at all if it is better because I don't know that language (translations is a problem for me since I can't be sure that all is perfect here). So you guys please decide which one is better. :)
Dalai wrote:Last, and actually the least: there's a copy'n'paste error in the English section of readme.txt of the current version: The part describing the Language in the .ini file contains Russian text.
Oops, you're right! I'll fix Language key description.
User avatar
Dalai
Power Member
Power Member
Posts: 9386
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

MVV wrote:Wow, you found a task that lasts longer than multiple seconds. :D I'll put your wish into my TODO list.
Thanks. Well, I know it's not so often that the process takes more than a couple of seconds to complete, so it's a "nice to have" rather than a "must have".
Thank you for translation but I don't know at all if it is better because I don't know that language. So you guys please decide which one is better. :)
Maybe you can include it as German2.lng or something, so the user can decide which one to use (or even create a third one out of both of them ;)).

Regarding the bug: I used version 1.0.5.266, just in case it matters (it was a couple of days before you published build 272).

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I've checked, there were no error message on long path because my link creation function failed to get file type and returned error code immediately before callink link creation API.
I'll try adding error message, and of course long path support.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Please test new version with long path support (up to 1024 characters):

NTLinks Maker 1.1.0.300
User avatar
Dalai
Power Member
Power Member
Posts: 9386
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

MVV wrote:Please test new version with long path support (up to 1024 characters)
Seems to work fine with long source as well as long target paths. Thanks. Just out of curiosity (and without having tested this): Does NTLinksMaker show some (error) message if it encounters any path longer than it can handle? On the other hand, TC itself can "only" handle paths with 1022 characters...

Now you only need to add long path support to NTLinks content plugin ;).

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Thank you for testing:)
Just out of curiosity (and without having tested this): Does NTLinksMaker show some (error) message if it encounters any path longer than it can handle? On the other hand, TC itself can "only" handle paths with 1022 characters...
I think it will report error in case of path truncation because some source item paths will be wrong.
Now you only need to add long path support to NTLinks content plugin
Perhaps that should really be done...
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Just noticed that new version creates broken junctions... fixed it:

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

Post by *MVV »

Dalai wrote:Now you only need to add long path support to NTLinks content plugin ;).
Well, now you can test it. :D

It has required much more changes in NTLinks than in NTLinks Maker (thanks to dumb M$ prefix for long paths) but it seems to work fine:

NTLinks 1.6.0.242

While testing it, I was unable to enter my test link in TC... but then I've understood that it would lead to path longer than 1024 characters that is not supported by TC.
User avatar
Dalai
Power Member
Power Member
Posts: 9386
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

Thank you! RP_Target field is cut at 259 characters in a custom columns view. That's a TC limitation, isn't it?

Editing the long path of a junction works fine, though.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Try viewing RP_Target in a tooltip, as I remember, it worked fine for me with long path.
User avatar
Dalai
Power Member
Power Member
Posts: 9386
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

That works indeed. But I don't use tooltips because I don't like them, and they may cause trouble because of some shell extensions (that have been tested only with Explorer).

So it's a TC limitation, and we have to wait for Ghisler to support it. Let's hope it doesn't take years :).

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Well, tooltip here is just a way to quickly check that NTLinks does it right way. :)

I use tooltips BTW much more than custom columns, they show me link type, number of hardlinks etc. They would be more useful if TC could merge tooltips for multiple file patterns but...

BTW editing junction paths is nicer with my Autorun subplugin that enables resizing of Attributes dialog. :D
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

2MVV
Thanks for great plugin and ulility. Some questions/suggestions.
1. I wonder if 8.3 names can be added to secondary hard links. Neither of tools I tried, including NTLinksMaker, can add 8.3 name to new hard link. It's easy to check by disabling Long names display in TC. Can you please check if it is possible? If yes, please add the possibility to NTLinksMaker.
2. Readme file states that hardlinks are supported since Windows 2000 and symbolic links are since Windows Vista.
In Windows hard links are supported since NT4 where Link Shell Extension can make them. If Windows 2000 is just a limitation of NTLinksMaker, would be better to add a note about it in a readme.
Symbolic links support also backported to Windows XP (3rd party a driver by Masatoshi Kimura), note about it can also be added to readme.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

1. How do you work with 8.3 names if they are disabled? Anyway, NTLinks Maker doesn't make any changes in names or paths, it just uses ones that you've passed to it.
Or do you mean that newly created links don't have 8.3 names? I can't add these names, it is OS who manages such things, I only call CreateHardLinkW function.

2. Unfortunately I can't check if NT4 supports hardlinks because oldest Windows NT I've seen is Windows 2000, so it would be nice to see some official documentation stated about this support.
Regarding 3rd party drivers - it is interesting to know but I don't want to mention non-official things. Also I doubt that NTLinks Maker will allow symlink creation under Windows XP because it uses CreateSymbolicLinkW function from standard Windows library.
Post Reply