ConFoo Montreal 2026: Call for Papers

Voting

: seven plus two?
(Example: nine)

The Note You're Voting On

Jasper Bekkers
19 years ago
For a backup utility I needed link-like functionality on a windows system. As it isn't availible on windows, i tried to do it myself with the help of some tools. All you need is junction.exe from sysinternals in your %PATH%.

<?php
if(!function_exists('link')){ // Assume a windows system
function link($target, $link){
if(
is_dir($target)){
// junctions link to directories in windows
exec("junction $link $target", $lines, $val);
return
0 == $val;
}elseif(
is_file($target)){
// Hardlinks link to files in windows
exec("fsutil hardlink create $link $target", $lines, $val);
return
0 == $val;
}

return
false;
}
}
?>

http://www.sysinternals.com/Utilities/Junction.html

<< Back to user notes page

To Top