Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

opendir() Resource id #3 error

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

opendir() Resource id #3 error

Postby sania260790 » Fri Apr 04, 2014 4:19 am

Hello,

My code is

$path = "../Data/01_OPL-277/02_SEISMIC DATA/01_2D SEISMIC/01_OLD 2D/01_2D NAVIGATION DATA/";
$dir_handle = opendir($path) or die("Error");

The result I get is "Error". I have other files with the opendir() function but they work. When I tried to echo the result of $path with the code:

$path = "../Data/01_OPL-277/02_SEISMIC DATA/01_2D SEISMIC/01_OLD 2D/01_2D NAVIGATION DATA/";
$dir_handle = opendir($path);
echo $dir_handle;

I get the result "Resource id #3".
Does anyone know what that means?
sania260790
New php-forum User
New php-forum User
 
Posts: 1
Joined: Fri Apr 04, 2014 4:07 am

Re: opendir() Resource id #3 error

Postby seandisanti » Sat Apr 05, 2014 10:12 am

According to the documentation, http://us2.php.net/opendir the resource is you handle which you successfully received with the opendir() call. Which tells me it's actually one of the subsequent uses of that handle that's actually failing. Make sure that your permissions are correct on the directory so that your script can do whatever it needs to do.
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.