note 26182 added to function.chdir
| From: | hielkehoeve at home dot n | Date: | Mon, 21 Oct 2002 19:46:05 +0000 |
| Subject: | note 26182 added to function.chdir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-38380@lists.php.net to get a copy of this message | ||
>what confused me was the command >order when opening a directory handle >and change to
>another directory.
>
>this seems right:
>1. chdir( towhereyouwanngo );
>2. $fh = opendir( "." );
>3. ... further operations
>4. closedir( $fh );
>
>i tried first to open an directory handle >and then to change directory. this >won't
>work.
It might be a good idea to put an if around "chdir( towhereyouwanngo )". This way your
page won't crash that quick. And you can put error reports on your site...
--
http://www.php.net/manual/en/function.chdir.php
http://master.php.net/manage/user-notes.php?action=edit+26182
http://master.php.net/manage/user-notes.php?action=delete+26182
http://master.php.net/manage/user-notes.php?action=reject+26182