Doc #54589 [Opn->Bgs]: Example 1 for opendir() has a typo and won't work

From: Date: Fri, 22 Apr 2011 02:47:48 +0000
Subject: Doc #54589 [Opn->Bgs]: Example 1 for opendir() has a typo and won't work
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-6275@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=54589&edit=1 ID: 54589 Updated by: dtajchreber@php.net Reported by: jim_clark at pacbell dot net Summary: Example 1 for opendir() has a typo and won't work -Status: Open +Status: Bogus Type: Documentation Problem Package: Documentation problem Operating System: all PHP Version: Irrelevant Block user comment: N Private report: N New Comment: The example works fine... $dir has a trailing slash in the example... when you copied and pasted the example, did you modify the value of $dir? Did you include a trailing slash like in the example? Previous Comments: ------------------------------------------------------------------------ [2011-04-22 04:10:59] jim_clark at pacbell dot net Description: ------------ --- From manual page: http://us.php.net/manual/en/function.opendir.php --- This line in the example: echo "filename: $file : filetype: " . filetype($dir . $file) . "\n"; should be: echo "filename: $file : filetype: " . filetype($dir . "/" . $file) . "\n"; Test script: --------------- 1. copy-and-paste the example as shown - it will generate lstat errors 2. change the echo line as above, and it works. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=54589&edit=1

« previous php.doc.bugs (#6275) next »