gillesg Posted March 22, 2016 Share Posted March 22, 2016 (edited) Hi all, I need to make a dircopy function that correctly handle symlink and junction without duplicating files and folder. Let's try to be more precise I have the following directory structure My folder---+ | |-- Local.file (regular file) |-- local folder (regular folder) |-- Target.symlink (symlink to file Local.file) |-- target.folder.symlink (symlink to folder local.folder) |-- target.folder.junction (junction to folder D:\PAC_Launchers\test\local.folder) 22/03/2016 21:42 10 Local.file 22/03/2016 21:41 <REP> local.folder 22/03/2016 21:42 11 Target.file 22/03/2016 21:40 <REP> Target.folder 22/03/2016 15:16 <JONCTION> target.folder.junction [D:\PAC_Launchers\test\local.folder] 22/03/2016 15:15 <SYMLINKD> target.folder.symlink [local.folder] 22/03/2016 07:42 <SYMLINK> Target.symlink [Local.file] To do so, i need to be able to identify that a file or a folder is a Symlink or Junction. And in that case I need to know the target of the symlink or junction. Does any of you have an idea or a script to do so. Gilles Edited March 23, 2016 by gillesg Link to comment Share on other sites More sharing options...
czyt Posted March 24, 2016 Share Posted March 24, 2016 search “ _GetReparseTarget ” and “symlink” in the forum will help you. 董小姐,你微笑的时候很美,就像安河桥下,清澈的水... Link to comment Share on other sites More sharing options...
gillesg Posted March 24, 2016 Author Share Posted March 24, 2016 Thanks, I did not look for the right keywords. I update the post when further in the implementation. Link to comment Share on other sites More sharing options...
gillesg Posted March 26, 2016 Author Share Posted March 26, 2016 (edited) Hello, I started the work. it looks fine, but I bumped into the following problem. How to determine a file is a Hardlink ? I mean created by either the cmd "mklink /H" or the Autoit function "FileCreateNTFSLink" The only way I found so far is using fsutil.exe hardlink list <the file to test> Any idea more autoit related ? Edited March 26, 2016 by gillesg Link to comment Share on other sites More sharing options...
gillesg Posted March 29, 2016 Author Share Posted March 29, 2016 Hi there, I finaly found what I was looking for : _WinAPI_EnumHardLinks function. This function give the list of hardlink path for the file. Link to comment Share on other sites More sharing options...
gillesg Posted March 29, 2016 Author Share Posted March 29, 2016 I am almost there. Does anyone knows how to create de Junction with Autoit. These are also known as REPARSE_POINT. Thank for any help provided. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now