Hard links - detecting their presence

Jun 7, 2008
121
0
Hi

How do I know if a file is a hard link?
It does not seem detectable in TCC
Neither ATTRIB nor a DIR switch seems to show up anything.

Thanks

Stephen Howe
 

dim

Dimitry Andric
May 31, 2008
205
1
Netherlands
How do I know if a file is a hard link?
It does not seem detectable in TCC
Neither ATTRIB nor a DIR switch seems to show up anything.

You cannot find out (easily) which other links a certain file has, but it is easy to see if two (or more) files are hard linked together, using the @INODE function:

Code:
D:\Tmp>echo foo > foo

D:\Tmp>mklnk foo bar
D:\Tmp\bar -> D:\Tmp\foo

D:\Tmp>dir foo bar
2009-05-06  20:28               5  foo
2009-05-06  20:28               5  bar

D:\Tmp>echo %@inode[foo] %@inode[bar]
00500000:000DAD6E 00500000:000DAD6E

D:\Tmp>if %@inode[foo]==%@inode[bar] echo foo and bar are the same file
foo and bar are the same file
 
May 20, 2008
3,515
4
Elkridge, MD, USA
dim wrote:
| ---Quote (Originally by Stephen Howe)---
| How do I know if a file is a hard link?
| It does not seem detectable in TCC
| Neither ATTRIB nor a DIR switch seems to show up anything.
| ---End Quote---
| You cannot find out (easily) which other links a certain file has,
| but it is easy to see if two (or more) files are hard linked
| together, using the @INODE function:
...

and the @links[] function tells you how many directory entries exist for the
file (i.e., it can be used to determine whether or not any other "file"
(i.e., directory entry) is hard linked the file of interest.
--
HTH, Steve
 
Similar threads
Thread starter Title Forum Replies Date
B Disk usage and hard links Support 16
R TCC IDE Tabs - inactive tabs hard to see Support 14
J Maybe Not So Hard Pdir Question Support 1
C Attaching PowerShell changes its colors and makes it hard to read Support 15
J Two hard to reproduce errors Support 0
T Documentation Download links Support 4
Charles Dye Outdated download links on the web site Support 1
D Documentation Dangling links in the helpfile Support 4
Joe Caverly Links to TCC/LE Support 0
Charles Dye Old download links on JPSoft.com home page Support 0
O I cannot use links to .btm files Support 5
Joe Caverly 7zip command links to zip help Support 0
vefatica Documentation Help: links to "Conditional expressions" don't work Support 2
M How to? want to download a file from a website enumarate the links and download the files Support 2
vefatica Bad links in announcement Support 2
C Working with links Support 6
E Cascadepoint Links Support 4
Dan Glynhampton Documentation v15 help: More mailto: links Support 2
Dan Glynhampton Documentation v15 help: More odd mailto: links in the help Support 8
Dan Glynhampton Documentation v15 help: Strange links in @INT topic Support 0
Dan Glynhampton Documentation v15 help: Incorrect Links Support 0
Dan Glynhampton Documentation Bad links in v15 help Support 0
D Documentation @ISPUNCT has rogue links Support 2
T 'All Downloads' page still links to v13 Support 2
S Create links or junctions on network drive Support 5
D What are the rules for detecting multiple versions of TC on a machine? Support 7
mikea How to? Detecting clipboard format Support 7
S Detecting existence of internet connection Support 11
Stefano Piccardi detecting BOM, FFIND multibyte regex Support 18

Similar threads