Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[WDX] NTLinks: Hardlinks and NTFS reparse points info
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
 
Post new topic   Reply to topic    Total Commander Forum Index -> Plugins and addons: devel.+support (English) Printable version
View previous topic :: View next topic  
Author Message
tbeu
Power Member
Power Member


Joined: 04 Jul 2003
Posts: 1079
Location: Germany

PostPosted: Tue Jan 31, 2012 4:09 am    Post subject: Reply with quote

Couly you please add one field (or multiple fields/units) to display all the file names of a hard linked file. I found one example here: http://blogs.msdn.com/b/oldnewthing/archive/2011/07/20/10188033.aspx
_________________
My plugins: Autodesk 3ds Max Preview, Blat Mailer, ImageMetaData (JPG Comment/EXIF/IPTC/XMP) , MATLAB MAT-file Viewer, SolidWorks Preview and more
Back to top
View user's profile Send private message Send e-mail Visit poster's website
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 5661
Location: Russian Federation

PostPosted: Tue Jan 31, 2012 11:04 am    Post subject: Reply with quote

tbeu, thanks for idea, I've added such feature, please test it.

NTLinks 1.5.2.180 32/64

You can see all hardlinks in single string or get them one by one. Plugin allows to return first 10 items (with indexes 0-9), I think it is enough.
_________________
VirtualPanel plugin: Temporary panel for TC (forum)
TOTALCMD.NET: TCFS2, NTLinks, CopyTree, AskParam, ConPaste, Sudo…
Back to top
View user's profile Send private message Send e-mail
tbeu
Power Member
Power Member


Joined: 04 Jul 2003
Posts: 1079
Location: Germany

PostPosted: Tue Jan 31, 2012 1:22 pm    Post subject: Reply with quote

MVV wrote:
I've added such feature, please test it.
Wow, that was quick! Thank you! Cannot test on WinXPSP3 Crying or Very sad
_________________
My plugins: Autodesk 3ds Max Preview, Blat Mailer, ImageMetaData (JPG Comment/EXIF/IPTC/XMP) , MATLAB MAT-file Viewer, SolidWorks Preview and more
Back to top
View user's profile Send private message Send e-mail Visit poster's website
zeeko
Junior Member
Junior Member


Joined: 21 Feb 2009
Posts: 20

PostPosted: Tue Jan 31, 2012 3:28 pm    Post subject: Reply with quote

MVV, thanks for the great feature.
It works on Windows7 (TC8B17a x64 and 7.56a).
Is it possible to have a custom separator for file names? LineFeed (\n) separator would be great for tooltips (each file name in the new row).
Back to top
View user's profile Send private message
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 5661
Location: Russian Federation

PostPosted: Tue Jan 31, 2012 11:38 pm    Post subject: Reply with quote

tbeu wrote:
MVV wrote:
I've added such feature, please test it.
Wow, that was quick! Thank you! Cannot test on WinXPSP3 Crying or Very sad

Yes, unfortunately XP doesn't provide similar API, so this field doesn't work here (the only way to find hardlinks on XP is to copy file index and search all files with same index within whole drive). And I need to link theese functions dynamically to keep backward compatibility.

zeeko wrote:
Is it possible to have a custom separator for file names? LineFeed (\n) separator would be great for tooltips (each file name in the new row).

I've tried "\n" and "\r\n" first of all, but TC replaces them with spaces and wraps long lines itself, it looks quite ugly. So I think comma is the best of the rest.

But you can use construction like [=ntlinks.HLNK_Paths.0]\n[=ntlinks.HLNK_Paths.1]\n[=ntlinks.HLNK_Paths.2]... to see any number of items on separate lines (if the field is empty, empty line will be shown).
_________________
VirtualPanel plugin: Temporary panel for TC (forum)
TOTALCMD.NET: TCFS2, NTLinks, CopyTree, AskParam, ConPaste, Sudo…
Back to top
View user's profile Send private message Send e-mail
zeeko
Junior Member
Junior Member


Joined: 21 Feb 2009
Posts: 20

PostPosted: Wed Feb 01, 2012 5:55 pm    Post subject: Reply with quote

Thanks for the tip!
Is there a way to display the size of symbolic link target file?
tc.size displays 0 bytes for symbolic link size, and I can't find a way to display target file size in the tooltips.
Back to top
View user's profile Send private message
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 5661
Location: Russian Federation

PostPosted: Wed Feb 01, 2012 11:52 pm    Post subject: Reply with quote

I think you can't. Symbolic links for files always have zero size, also their attributes may be outdated when you sync folders (therefore I don't use them). However hardlinks may have outdated dates too.
_________________
VirtualPanel plugin: Temporary panel for TC (forum)
TOTALCMD.NET: TCFS2, NTLinks, CopyTree, AskParam, ConPaste, Sudo…
Back to top
View user's profile Send private message Send e-mail
zeeko
Junior Member
Junior Member


Joined: 21 Feb 2009
Posts: 20

PostPosted: Fri Feb 03, 2012 4:45 pm    Post subject: Reply with quote

I did some search how to get target file size. There is a flag in CreateFile function responsible for symlink processing. If dwFlagsAndAttributes param contains FILE_FLAG_OPEN_REPARSE_POINT value, functions GetFileSize, GetFileSizeEx, GetFileInformationByHandle, GetFileInformationByHandleEx,... return symbolic link size - 0 bytes. If file is open without FILE_FLAG_OPEN_REPARSE_POINT value, functions return target file size > 0 bytes. Could you please check this, and if it works, add another field with target file size?
Back to top
View user's profile Send private message
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 5661
Location: Russian Federation

PostPosted: Sat Feb 04, 2012 1:01 am    Post subject: Reply with quote

I thought about it, but I was too lazy to add field with such ammount of units (tc.size provides 8 units - bytes, kbytes, Mbytes, Gbytes and floating ones). Maybe I'll add such field with only integral units.

Well, I found extra compact way to work with units (B, KB, MB, GB). Very Happy
Code:
filesize.QuadPart>>=10*UnitIndex;



NTLinks 1.5.2.190 32/64
+ new field to get real size of a file behind symlink
_________________
VirtualPanel plugin: Temporary panel for TC (forum)
TOTALCMD.NET: TCFS2, NTLinks, CopyTree, AskParam, ConPaste, Sudo…
Back to top
View user's profile Send private message Send e-mail
zeeko
Junior Member
Junior Member


Joined: 21 Feb 2009
Posts: 20

PostPosted: Sat Feb 04, 2012 6:23 pm    Post subject: Reply with quote

Thanks!
It works, but only for x86.
wdx_NTLinks_1.5.2.190.zip contains an old version of NTLinks.wdx64, v1.5.2.160. Surprised
Back to top
View user's profile Send private message
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 5661
Location: Russian Federation

PostPosted: Sun Feb 05, 2012 1:04 am    Post subject: Reply with quote

Well, sorry. Smile
I'm using only TCx86 usually (but I have 64-bit versions for tests), so didn't notice that.

Package is updated.


Added on Feb 06 2012:

New version is out, a pair of bugs was fixed.

NTLinks 1.5.3.200 32/64
* wrong real path for file symlinks
* full target was shown instead of relative one sometimes
_________________
VirtualPanel plugin: Temporary panel for TC (forum)
TOTALCMD.NET: TCFS2, NTLinks, CopyTree, AskParam, ConPaste, Sudo…
Back to top
View user's profile Send private message Send e-mail
zeeko
Junior Member
Junior Member


Joined: 21 Feb 2009
Posts: 20

PostPosted: Mon Feb 06, 2012 4:44 pm    Post subject: Reply with quote

Is it possible to set HLNK_Count to zero if symlink/junction is not valid (RP_IsValid=No) ?
Or HLNK_Count=0 holds different information?
Back to top
View user's profile Send private message
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 5661
Location: Russian Federation

PostPosted: Mon Feb 06, 2012 11:27 pm    Post subject: Reply with quote

Theese are completely different things. Number of hardlinks is a number of folder entries, and it cannot be less than 1. Every reparse point is a separate file system object and it also has folder entry, it is not correct to mix hardlinks and reparse points.
_________________
VirtualPanel plugin: Temporary panel for TC (forum)
TOTALCMD.NET: TCFS2, NTLinks, CopyTree, AskParam, ConPaste, Sudo…
Back to top
View user's profile Send private message Send e-mail
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 5661
Location: Russian Federation

PostPosted: Thu Apr 26, 2012 7:11 am    Post subject: Reply with quote

Another pair of bugs fixed.

NTLinks 1.5.3.214 (changes since 1.5.3.200):
* improved junction detection if path starts with volume GUID
* ANSI to Unicode conversion bug in non-Unicode functions (introduced in 1.5.0.108)

NTLinks 1.5.3.214 32/64
_________________
VirtualPanel plugin: Temporary panel for TC (forum)
TOTALCMD.NET: TCFS2, NTLinks, CopyTree, AskParam, ConPaste, Sudo…
Back to top
View user's profile Send private message Send e-mail
sgp
Senior Member
Senior Member


Joined: 31 Jan 2005
Posts: 308

PostPosted: Sat Apr 28, 2012 2:01 am    Post subject: Reply with quote

Wow, symlink file target resolution works on XP too even though XP doesn't support file symlinks. That's very cool! Thank you for this update.

Edit: However, RP_IsValid returns Yes on XP for file symlinks. Shouldn't it return No instead (and still resolve the symlink, since your plugin can?)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> Plugins and addons: devel.+support (English) All times are GMT - 6 Hours
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
Page 6 of 7

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Impressum: This site is maintained by Ghisler Software GmbH

Using phpBB © 2001-2005 phpBB Group