PHP/File Directory/symlink

Материал из Web эксперт
Перейти к: навигация, поиск

Making a symbolic link

 
<?php
symlink("/usr/local/images","/www/docroot/images") or die($php_errormsg);
?>



symlink.php

 
<?php
     $link = symlink("/www/htdocs/stats/2003", "/www/htdocs/stats/03");
?>



Working with Links

 
<?
    $result = link("/home/paul/myfile.txt", "/home/andrew/myfile.txt");
    if (!$result) {
            echo "Hard link could not be created!\n";
    } else {
            $result = symlink("/home/paul/myfile.txt", "/home/andrew/myfile.txt");
            if (!$result) {
                    echo "Symlink could not be created either!\n";
            }
    }
?>