diff options
-rw-r--r-- | Lib/ftplib.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/ftplib.py b/Lib/ftplib.py index 6a36df4..0dc0d6e 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py @@ -358,6 +358,16 @@ class FTP: raise error_reply, resp self.voidcmd('RNTO ' + toname) + # Delete a file + def delete(self, filename): + resp = self.sendcmd('DELE ' + filename) + if resp[:3] == '250': + return + elif resp[:1] == '5': + raise error_perm, resp + else: + raise error_reply, resp + # Change to a directory def cwd(self, dirname): if dirname == '..': |