File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ impl FtpStream {
82
82
} ;
83
83
self . secure_with_ssl ( ssl)
84
84
}
85
-
85
+
86
86
/// Switch to a secure mode if possible, using a provided SSL configuration.
87
87
/// This method does nothing if the connect is already secured.
88
88
///
@@ -447,6 +447,14 @@ impl FtpStream {
447
447
Ok ( ( ) )
448
448
}
449
449
450
+ /// Remove the remote file from the server.
451
+ pub fn rm ( & mut self , filename : & str ) -> Result < ( ) > {
452
+ let rm_command = format ! ( "DELE {}\r \n " , filename) ;
453
+ try!( self . write_str ( & rm_command) ) ;
454
+ try!( self . read_response ( status:: REQUESTED_FILE_ACTION_OK ) ) ;
455
+ Ok ( ( ) )
456
+ }
457
+
450
458
fn put_file < R : Read > ( & mut self , filename : & str , r : & mut R ) -> Result < ( ) > {
451
459
let stor_command = format ! ( "STOR {}\r \n " , filename) ;
452
460
let mut data_stream = BufWriter :: new ( try!( self . data_command ( & stor_command) ) ) ;
You can’t perform that action at this time.
0 commit comments