PHP/File Directory/is link — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
|
Текущая версия на 10:04, 26 мая 2010
Using the File-System Logic Functions
<source lang="html4strict">
<?php
$testfile = "data.txt"; if(!file_exists($testfile)) { echo "Error -- $testfile doesn"t exist!
"; exit; } echo "What we know about the file $testfile
"; if(is_dir($testfile)) echo "It is a directory.
"; if(is_file($testfile)) echo "It is an actual file (not symbolic link)
"; if(is_link($testfile)) echo "It is a symbolic link to a real file
"; if(is_uploaded_file($testfile)) echo "It is an uploaded file
"; if(is_readable($testfile)) echo "The file is readable by PHP
"; if(is_writeable($testfile)) echo "The file is writeable by PHP
"; if(is_executable($testfile)) echo "The file is executable by PHP
";
?>
</source>