mirror of
https://github.com/wiiu-env/ftpiiu_plugin.git
synced 2024-11-18 02:39:21 +01:00
implement RMD
This commit is contained in:
parent
24ec52babb
commit
020f4c21df
30
source/ftp.c
30
source/ftp.c
@ -2012,12 +2012,38 @@ FTP_DECLARE(RETR)
|
|||||||
|
|
||||||
FTP_DECLARE(RMD)
|
FTP_DECLARE(RMD)
|
||||||
{
|
{
|
||||||
/* TODO */
|
#ifdef _3DS
|
||||||
|
Result ret;
|
||||||
|
#else
|
||||||
|
int rc;
|
||||||
|
#endif
|
||||||
|
|
||||||
console_print("%s %s\n", __func__, args ? args : "");
|
console_print("%s %s\n", __func__, args ? args : "");
|
||||||
|
|
||||||
ftp_session_set_state(session, COMMAND_STATE);
|
ftp_session_set_state(session, COMMAND_STATE);
|
||||||
|
|
||||||
return ftp_send_response(session, 502, "unavailable\r\n");
|
if(validate_path(args) != 0)
|
||||||
|
return ftp_send_response(session, 553, "invalid file name\r\n");
|
||||||
|
|
||||||
|
build_path(session, args);
|
||||||
|
|
||||||
|
#ifdef _3DS
|
||||||
|
ret = FSUSER_DeleteDirectory(NULL, sdmcArchive, FS_makePath(PATH_CHAR, session->buffer));
|
||||||
|
if(ret != 0)
|
||||||
|
{
|
||||||
|
console_print("FSUSER_DeleteDirectory: 0x%08X\n", (unsigned int)ret);
|
||||||
|
return ftp_send_response(session, 550, "failed to delete directory\r\n");
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
rc = rmdir(session->buffer);
|
||||||
|
if(rc != 0)
|
||||||
|
{
|
||||||
|
console_print("rmdir: %s\n", strerror(errno));
|
||||||
|
return ftp_send_response(session, 550, "failed to delete directory\r\n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return ftp_send_response(session, 250, "OK\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
FTP_DECLARE(RNFR)
|
FTP_DECLARE(RNFR)
|
||||||
|
Loading…
Reference in New Issue
Block a user