Re: ftp root dir?

From: Date: Tue, 22 May 2007 15:19:22 +0000
Subject: Re: ftp root dir?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-255325@lists.php.net to get a copy of this message
I know that; but, I writing a script, that can be used on different servers, which creates a directory and I want to make certain it is created on the DOC ROOT. I don't want the user to have to test the ftp connection with a ftp utility program first. Jim Moseby wrote:
r?
Can I assume that all ftp_connect()s will make the current dir the DOC_ROOT? If not, how can I insure the ftp root dir is the same as DOC_ROOT? You can't use the absolute path with ftp. chdir() doesn't change the ftp current dir. if you ftp_chdir() and it's already on the root, it posts an error. ftp_pwd() simply returns "/", which simply says it's on its root, where ever that is.
The ftp_* functions behave just as any ftp client behaves, AFAIK. If you log into the FTP server via your favorite command-line FTP client, you are seeing the exact same behaviour as the ftp_* functions will see. JM


« previous php.general (#255325) next »