note 87161 added to function.filetype
| From: | 7r6ivyeo at mail dot com | Date: | Sat, 22 Nov 2008 01:29:09 +0000 |
| Subject: | note 87161 added to function.filetype | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-146818@lists.php.net to get a copy of this message | ||
I use the CLI version of PHP on Windows Vista. Here's how to determine if a file is marked
"hidden" by NTFS:
<?php
function is_hidden_file($fn) {
$attr = trim(exec('FOR %A IN ("'.$fn.'") DO @ECHO %~aA'));
if($attr[3] === 'h')
return true;
return false;
}
?>
Changing <?php if($attr[3] === 'h') ?> to <?php if($attr[4] === 's')
?> will check for system files.
This should work on any Windows OS that provides DOS shell commands.
----
Server IP: 69.147.83.197
Probable Submitter: 76.3.20.246
----
Manual Page -- http://www.php.net/manual/en/function.filetype.php
Edit -- https://master.php.net/note/edit/87161
Del: integrated -- https://master.php.net/note/delete/87161/integrated
Del: useless -- https://master.php.net/note/delete/87161/useless
Del: bad code -- https://master.php.net/note/delete/87161/bad+code
Del: spam -- https://master.php.net/note/delete/87161/spam
Del: non-english -- https://master.php.net/note/delete/87161/non-english
Del: in docs -- https://master.php.net/note/delete/87161/in+docs
Del: other reasons-- https://master.php.net/note/delete/87161
Reject -- https://master.php.net/note/reject/87161
Search -- https://master.php.net/manage/user-notes.php