note 67570 modified in function.stat by danbrown
| From: | danbrown@php.net | Date: | Thu, 16 Oct 2008 13:29:34 +0000 |
| Subject: | note 67570 modified in function.stat by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-145414@lists.php.net to get a copy of this message | ||
salisbm at hotmail dot com said :
(...)to see if the file is a directory, after calling fstat, I do:
if ($fstats[mode] & 040000)
... this must be a directory
Then I say no no no no... it can be a directory or a named pipe, or a block spécial ...
The good code for this thing is :
<?php
if(($fstat['mode'] & 0170000) == 040000) echo "Be sure it is a directory !";
?>
Sorry for very ugly english ;)
@+
--was--
salisbm at hotmail dot com said :
(...)to see if the file is a directory, after calling fstat, I do:
if ($fstats[mode] & 040000)
... this must be a directory
Then I say no no no no... it can be a directory or a named pipe, or a block spécial ...
The good code for this thing is :
<?
if(($fstat['mode'] & 0170000) == 040000) echo "Be sure it is a directory !";
?>
Sorry for very ugly english ;)
@+
http://php.net/manual/en/function.stat.php