//php4 equivalent of the php5 function
if (!function_exists('ftp_chmod')) {
function ftp_chmod($ftpstream,$chmod,$file)
{
$old=error_reporting();//save old
error_reporting(0);//set to none
$result=ftp_site($ftpstream, "CHMOD ".$chmod." ".$file);
error_reporting($old);//reset to old
return $result;//will result TRUE or FALSE
}
}
//demonstration of the function
$ftp_ip="yourserverip";
$ftp_login="theuser";
$ftp_pass="thepassword";
$ftp_file="test.txt";
$conn_id=ftp_connect($ftp_ip);
$login_result=@ftp_login($conn_id, $ftp_login, $ftp_pass);
if(ftp_chmod($conn_id,"0775",$ftp_file)==FALSE)print"ERROR FTP_CHMOD: can't change chmod of $ftp_file";
ftp_quit($conn_id);