RE: [PHP-WIN] problem to open dir
| From: | Gryffyn, Trevor | Date: | Tue, 30 Nov 2004 14:40:17 +0000 |
| Subject: | RE: [PHP-WIN] problem to open dir | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-25082@lists.php.net to get a copy of this message | ||
I think \' is going to quote the single-quote too. Best to quote the
backslashes I guess. Change all the \ to \\
Also.. Silly question.. But that directory DOES exist, right?
I assume the is_dir() line is 69 and the opendir() is line 70, correct?
-TG
> -----Original Message-----
> From: Mike [mailto:php@crazyted.com]
> Sent: Tuesday, November 30, 2004 12:06 AM
> To: 'Pravin-Kumar'; php-windows@lists.php.net
> Subject: RE: [PHP-WIN] problem to open dir
>
>
> When you set the $dir variable, try doing so with single
> quotes - the \
> character is used to escape things and might be causing some problems.
>
> If that makes no sense, it's because I'm falling asleep.
>
> Good luck.
>
> -M
>
> > -----Original Message-----
> > From: Pravin-Kumar [mailto:pravin@ncb.ernet.in]
> > Sent: Tuesday, November 30, 2004 12:37 AM
> > To: php-windows@lists.php.net
> > Subject: [PHP-WIN] problem to open dir
> >
> > hi all
> > i am getting some unexpected error while try to read a local dir..
> > it is working on the pc where apache is running ..but same
> > code not working while trying from other pcs in lan..
> > here is code..
> > $dir="C:\Documents and Settings\pravin\Desktop\abcd2"; if
> > (is_dir($dir)) {
> > if ($dh = opendir($dir)) {
> > while (($file = readdir($dh)) !== false) {
> > echo "filename: $file : filetype: " . filetype($dir
> > . $file) ."\n";
> > }
> > closedir($dh);
> > }
> > }
> >
> > $dir = dir($source);
> >
> >
> > giving error:
> > Warning: dir(C:\Documents and Settings\pravin\Desktop\cdac2):
> > failed to open dir: Invalid argument in
> > G:\Vyapar\AdvMgmt\addadvt3.php on line
> > 69
> >
> > Fatal error: Call to a member function on a non-object in
> > G:\Vyapar\AdvMgmt\addadvt3.php on line 70