Created
April 11, 2011 19:58
-
-
Save yuya-matsushima/914198 to your computer and use it in GitHub Desktop.
SplFileInfoのisFile(),isLink()の挙動がおかしい?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//ファイルは実際に存在 | |
$dat = '../sample.dat'; | |
$file = new SplFileInfo($dat); | |
switch(TRUE) | |
{ | |
case $file->isDir(): | |
echo 'ディレクトリです。', "<br>"; | |
case $file->isExecutable(): | |
echo '実行可能です。', "<br>"; | |
case $file->isFile(): | |
echo 'ファイルです。', "<br>"; | |
case $file->isLink(): | |
echo 'リンクです。', "<br>"; | |
case $file->isReadable(): | |
echo '読み取り可能です。', "<br>"; | |
case $file->isWritable(): | |
echo '書き込み可能です。', "<br>"; | |
} | |
//Result | |
//ファイルです。 | |
//リンクです。 | |
//読み取り可能です。 | |
//書き込み可能です。 | |
//リンク… |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment