in reply to Re^6: Perl command to Create/Remove windows link
in thread Perl command to Create/Remove windows link
First, the op ask for hardlinks not symbolic, so the proper function call would be CreateHardLink().
Second, whilst those two function calls 'do the job'; as coded in the stackoverflow link; they don't handle UNC or MBCS pathnames -- which is one of their major uses -- and they are far from robustly coded. By the time you've fixed that code up to map ansi link names to unc/mbcs paths; cleaned up the error handling; perhaps added in a few checks for self-referential and circular links; you are way beyond 1 function call. And then you've got to test it and maintain it. And all to replicate an OS command. Why?
Third, those APIs only exist on Vista or Server 200X or later. I strongly suspect that the main reason the OP was looking for a module to do hardlinks -- rather than just shelling out to mklink as also suggested at the bottom of your stackoverflow link -- is because he wants the functionality on earlier version of the OS where those APIs do not exist. That -- to me -- is the only logical reason for not using the command.
And there are supported tools around for doing some kinds of path linking on earlier OS versions.
|
|---|