|
Posted by shimmyshack on 05/17/07 13:46
On May 16, 8:50 am, "PeteC"
<newsgroupswebdev...@removethisbitacutecomputing.co.uk> wrote:
> I have a bit of code that looks like
>
> define("DIRECTORYPENDING","import/pending");
>
> $d = dir(DIRECTORYPENDING);
> while (false !== ($file = $d->read()))
> {
> // Process all files in that directory
> }
>
> Which works fine for directories within the website.
>
> In this particular case, however, the files I need are on a shared directory
> on another server on the LAN (all servers are Server2003) at
> \\server2\pending (or a mapped drive, Z:, pointing to the same location)
>
> I've tried
>
> define("DIRECTORYPENDING",\\server2\pending);
> define("DIRECTORYPENDING","Z:\pending");
>
> but it doesn't work (yes, I do have quotes in the correct place on the
> define statements above, but Outlook Express removed them!)
>
> The error message I get is
>
> Warning: dir(\\server2\pending\) [function.dir]: failed to open dir:
> Invalid argument in E:\TestOnline\lit\admin.php on line 58
>
> Where the line in error is the line containing $d = dir(DIRECTORYPENDING)
>
> So... how can I read the files from the remote directory? I have control of
> both servers, so can change permissions etc if required.
>
> TIA,
>
> Pete.
firstly use a decent newsreader that is capable of posting the actual
code to the group.
secondly backslashes are meaningful, so use \\\\server\\share
thirdly permissions must indeed be set correctly, access to share must
be granted to process under which php is running.
[Back to original message]
|