Net_FTP::rm()

Net_FTP::rm() -- deletes a file or directory.

Synopsis

require_once 'Net/FTP.php';

mixed Net_FTP::rm ([string $path = null [, string $recursive = false]])

Beschreibung

This method deletes a file or a directory.

Parameter

Rückgabewert

mixed - true on success, otherwise PEAR::Error.

Fehler-Meldungen

Several errors may be returned by rm. The errornumber is unspecific (until now) and will not tell you anything about the errormessage. Possible errors are:

Tabelle 49-1. Mögliche Fehler-Arten

Error messageDescriptionSolution
Could not delete file '$file'. The file named $file (complete path) could not be deleted. Either the file does not exist or you do not have the permission to delete it. So check if the file exists and you have permissions on it.
Directory name '$dir' is invalid, has to end with '/' You entered a directory for deletion ($recursive = true) without ending '/'. Correct your parameter.
Could not delete directory '$dir'. The directory $dir could not be deleted. Maybe the directory is not empty ($recursive = false) or you do not have the permission to delete the directory.

Hinweise

Diese Methode kann nicht statisch aufgerufen werden.

Beispiel