note 70927 added to function.symlink
| From: | php-general at lists dot php dot net | Date: | Sat, 04 Nov 2006 12:33:10 +0000 |
| Subject: | note 70927 added to function.symlink | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-119391@lists.php.net to get a copy of this message | ||
<?
/**
* A function to emulate symbolic links on Windows.
* Uses the junction utility available at:
* http://www.sysinternals.com
* Note that this will only work on NTFS volumes.
*
* The syntax of the junction utility is:
* junction <junction directory> <junction target>
*
* Note that the parameter order of the Junction command
* is the reverse of the symlink function!
*
* @param string $target
* @param string $link
*/
function _symlink( $target, $link ) {
if ($_SERVER['WINDIR'] || $_SERVER['windir']) {
exec('junction "' . $link . '" "' . $target .
'"');
} else {
symlink($target,$link);
}
}
function _unlink($link ) {
if ($_SERVER['WINDIR'] || $_SERVER['windir']) {
exec('junction -d "' . $link . '"');
} else {
unlink($link);
}
}
?>
----
Server IP: 194.109.193.119
Probable Submitter: 80.127.14.53
----
Manual Page -- http://www.php.net/manual/en/function.symlink.php
Edit -- https://master.php.net/note/edit/70927
Del: integrated -- https://master.php.net/note/delete/70927/integrated
Del: useless -- https://master.php.net/note/delete/70927/useless
Del: bad code -- https://master.php.net/note/delete/70927/bad+code
Del: spam -- https://master.php.net/note/delete/70927/spam
Del: non-english -- https://master.php.net/note/delete/70927/non-english
Del: in docs -- https://master.php.net/note/delete/70927/in+docs
Del: other reasons-- https://master.php.net/note/delete/70927
Reject -- https://master.php.net/note/reject/70927
Search -- https://master.php.net/manage/user-notes.php