Re: FTP and absolute path
| From: | Jason Wong | Date: | Sun, 04 May 2003 11:49:25 +0000 |
| Subject: | Re: FTP and absolute path | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-146342@lists.php.net to get a copy of this message | ||
On Sunday 04 May 2003 00:12, Jason Paschal wrote:
> Q: is there a function that i'm overlooking that will get me the absolute
> path of the FTP base directory?
>
>
> Trying to build a simple web-base FTP client for my own personal use. (I
> know there are tons already out there, but I still want to make my own.
>
> Using the ftp_pwd function, i get "/", and that's expected.
>
> $pwd = ftp_pwd($cn); //$pwd is equal to "/" upon connection
>
> I'd like to get the directory listing, but if I use opendir($pwd), php is
opendir() works on the local filesystem. Not sure whether it works for remote
files, assume that it does then you would still need to specify WHERE the
remote directory is possibly like so:
opendir('ftp://ftp.server.com/some/directory').
BUT ...
[snip]
> is there a function that i'm overlooking that will get me the absolute path
> of the FTP base directory?
... (yes) you should be using the ftp_*() functions such as ftp_chmod().
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
The road to ruin is always in good repair, and the travellers pay the
expense of it.
-- Josh Billings
*/