Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8202111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:03:26+00:00 2026-06-07T07:03:26+00:00

I’ve been playing around a lot recently with manipulating reparse points programmatically, and something’s

  • 0

I’ve been playing around a lot recently with manipulating reparse points programmatically, and something’s been bugging me for a little while now. Since Windows hard links aren’t reparse points like junctions or symbolic links, they can’t be accessed the same way. Creating a new one is easy enough, but I’ve yet to figure out how to read the target of one. Since extensions like Hard Link Shell Extension have property sheets displaying that information, I assume it can be done, but I’ve been unable to find any documentation on how. (I did notice that the shell extension doesn’t indicate which file is the real thing on hard links, though)

I did find this answer, which explains how to count the links to a file, but unfortunately, I’m still stuck on resolving.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T07:03:28+00:00Added an answer on June 7, 2026 at 7:03 am

    Hardlink information are stored in $FILE_NAME attributes using POSIX name. Each of these attributes refers to a file which may refers to the original file itself. A file without any hardlink may also have a POSIX name. In other words, a hardlinked file always has multiple POSIX names. The attribute’s DirectoryFileReferenceNumber field points to an MFT entry index, which is the folder entry that contains the file.

    Here are the guide to retrieve all targets of a file, whether it’s hardlinked or not.

    You will need to use FSCTL_GET_NTFS_FILE_RECORD on a file to get all of its NTFS attributes and parse it to retrieve each $FILE_NAME attribute.

    On each $FILE_NAME attribute, use FSCTL_GET_NTFS_FILE_RECORD on the volume where the file resides using its DirectoryFileReferenceNumber as MFT entry index to retrieve the file’s folder container information. This folder is the lowest level that contains the file. For example, if the file path is C:\MyData\Myfiles\MyDocument.txt, the lowest folder level is MyFiles. If the DirectoryFileReferenceNumber points to the root folder, which is 0x5, then you have the full path of the file. For example, C:\MyDocument.txt.

    With that folder information, if it is not a root folder, you simply repeat a similar task as above which is to retrieve the folder name from the Name field of $FILE_NAME attribute. But this time, the NameType does not have to be of POSIX type and any can be used. Preferably LFN or LFN & DOS8.3 compatible type. Use its DirectoryFileReferenceNumber to get the upper folder level and repeat the task in this paragraph. When the DirectoryFileReferenceNumber points to the root folder, which is 0x5, then this repeating tasks has completed since you already have the full path of the file.

    Now you have resolved one file target. The next task is to process the next $FILE_NAME attribute whose NameType is of POSIX type. Process all of them to get all file targets. Do not use this method to find out whether a file has hardlinks or not. Instead, use GetFileAttributes function since it is a lot faster.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.