FTP and absolute path

From: Date: Sat, 03 May 2003 16:12:15 +0000
Subject: FTP and absolute path
Groups: php.general 
Request: Send a blank email to php-general+get-146279@lists.php.net to get a copy of this message
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 trying to open the server root directory and i get an "open_basedir restriction in effect" error. so i tried concatenating ini_get('open_basedir') with $pwd, but the open_basedir is set to something like this "/data/httpd/vhosts/site.com/httpdocs:/tmp". (it's not my server, so i can't control these settings). and neither path in the open_basedir setting is the FTP root. i know what the FTP root directory is, i just want to get it programmatically, and hopefully without having to parse ini settings or whatnot, so the script remains flexible regardless of which server it sits on. is there a function that i'm overlooking that will get me the absolute path of the FTP base directory? _________________________________________________________________ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus

« previous php.general (#146279) next »