Jump to content

failed to open dir: no such file or directory


PirateNinjaNala

Recommended Posts

I want to write a program that will upload data from files into a database. The files are on a different server than the web server. This is what I am currently doing:

 

$directory  = "file://///zim/Bionutrition/Data" . " " . "Transfer/ESHA/";

$scandir = scandir($directory);

 

This is the error message that I get.

Warning: scandir(file://///zim/Bionutrition/Data Transfer/ESHA/) [function.scandir]: failed to open dir: No such file or directory in /home/web/gcrcstaff.crc.medctr.ohio-state.edu/bionutrition/data_mgt/ESHA/index.php on line 8

 

Warning: scandir() [function.scandir]: (errno 2): No such file or directory in /home/web/gcrcstaff.crc.medctr.ohio-state.edu/bionutrition/data_mgt/ESHA/index.php on line 8

 

I am absolutely sure that the path exists. I have copied and pasted that url into Firefox without a problem. I have tried accessing that directory by using the machine's IP address instead of its name, but I get an error that says "failed to open dir: not implemented".

I'm no expert but it looks like you have way too many ///s in that file path.

 

I've tried it without the extra slashes, but it still doesn't work. I've tried it with two and I've tried it with none.

 

you have a space between your path and filename. what's that about?

$directory  = "file://///zim/Bionutrition/Data" . " " . "Transfer/ESHA/";

if you have a space in your directory name, try escaping the whitespace like this:

file://zim/Bionutrition/Data\ Transfer/ESHA/";

 

or try this:

$directory = "file://zim/Bionutrition/Data/Transfer/ESHA/";

 

or try this:

$directory = "/zim/Bionutrition/Data/Transfer/ESHA/";

 

if you have a '/' at the very beginning of your path, this means that you are coming from the ROOT directory. is this where you want to start from?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.