ftp_connection::chmod

Description

Chmods the specified file to the specified value.

Syntax

bool ftp_connection::chmod (string $ftp_file, int $chmod)



Parameter $ftp_file

Expected type: String
Description: The name of the file to chmod



Parameter $chmod

Expected type: Integer
Description: The chmod value for the file (ie 0777)



Return value

Expected type: Boolean
Description: Whether or not the operation was successful


Notes

  • Example: $package_ftp->chmod('myfile.txt', 0666);
  • Sends the SITE CHMOD command to the FTP server
  • Converts $chmod from octal (0777) to text ("777")
  • Checks for a valid connection before continuing
  • Checks for a 200 response code (Command ok).
  • Sets a 'bad_file' error if the command wasn't successful
  • Returns false if there wasn't a valid connection or the command was unsuccessful
Advertisement: