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".

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.