rbtcollins / fs_at

Filesystem 'at' implementations for Unix and Windows

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support additional file objects - hardlinks

rbtcollins opened this issue · comments

NtSetInformationFile may be useful here. Specifically, using the FileLinkInformation class with the FILE_LINK_INFORMATION data structure.

RootDirectory permits safe construction of the link object itself, and the existing file handle is provided in the call to NtSetInformationFile, so this is safe.

For unix, linkat takes two dir handles, so similarly safe.