mirror of
https://github.com/m5stack/M5Stack_MicroPython.git
synced 2026-05-20 10:14:44 -07:00
FTP server, bugfix: not removing directories
This commit is contained in:
@@ -1018,10 +1018,20 @@ static void ftp_process_cmd (void) {
|
||||
}
|
||||
break;
|
||||
case E_FTP_CMD_DELE:
|
||||
ftp_get_param_and_open_child(&bufptr);
|
||||
if ((strlen(ftp_path) > 0) && (ftp_path[strlen(ftp_path)-1] != '/')) {
|
||||
if (unlink(ftp_path) == 0) {
|
||||
vTaskDelay(20 / portTICK_PERIOD_MS);
|
||||
ftp_send_reply(250, NULL);
|
||||
}
|
||||
else ftp_send_reply(550, NULL);
|
||||
}
|
||||
else ftp_send_reply(250, NULL);
|
||||
break;
|
||||
case E_FTP_CMD_RMD:
|
||||
ftp_get_param_and_open_child(&bufptr);
|
||||
if ((strlen(ftp_path) > 0) && (ftp_path[strlen(ftp_path)-1] != '/')) {
|
||||
if (unlink(ftp_path) >= 0) {
|
||||
if (rmdir(ftp_path) == 0) {
|
||||
vTaskDelay(20 / portTICK_PERIOD_MS);
|
||||
ftp_send_reply(250, NULL);
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user