FTPc: added cdup, mkd, and rmd commands.

git-svn-id: svn://kolibrios.org@3804 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2013-07-10 11:19:18 +00:00
parent 99eec4c8b8
commit a2f86b00f9
2 changed files with 52 additions and 3 deletions

View File

@ -225,6 +225,15 @@ wait_for_usercommand:
cmp dword[s], "lcwd"
je cmd_lcwd
cmp dword[s], "mkd "
je cmd_mkd
cmp dword[s], "rmd "
je cmd_rmd
cmp dword[s], "cdup"
je cmd_cdup
invoke con_write_asciiz, str_unknown
jmp wait_for_usercommand
@ -301,7 +310,7 @@ exit:
; data
title db 'FTP client',0
str1 db 'FTP client for KolibriOS v0.06',10,10,'Please enter ftp server address.',10,0
str1 db 'FTP client for KolibriOS v0.07',10,10,'Please enter ftp server address.',10,0
str2 db '> ',0
str3 db 'Resolving ',0
str4 db 10,0
@ -314,18 +323,22 @@ str11 db 'Connecting...',10,0
str12 db 'Waiting for welcome message.',10,0
str_user db "username: ",0
str_pass db "password: ",0
str_unknown db "unknown command",10,0
str_unknown db "unknown command or insufficient parameters",10,0
str_lcwd db "local working directory is now: ",0
str_help db "available commands:",10
db "help - help",10,10
db "help - help",10
db 10
db "bye - close connection",10
db "cdup - change to parent of current directory on server",10
db "cwd - change working directoy on server",10
db "dele - delete file from server",10
db "list - list files and folders in current directory",10
db "lcwd - change local working directory",10
db "mkd - make directory on the server",10
db "pwd - print working directory",10
db "retr - retreive file from server",10
db "rmd - remove directory from the server",10
db "stor - store file on server",10
db 10,0

View File

@ -149,6 +149,42 @@ cmd_lcwd:
jmp wait_for_usercommand
cmd_cdup:
mov dword[s], "CDUP"
mov byte[s+4], 0x0a
mcall send, [socketnum], s, 5, 0
jmp wait_for_servercommand
cmd_rmd:
mov dword[s], "RMD "
mov ecx, 256
xor al, al
mov edi, s
repne scasb
lea esi, [edi - s - 1]
mcall send, [socketnum], s, , 0
jmp wait_for_servercommand
cmd_mkd:
mov dword[s], "MKD "
mov ecx, 256
xor al, al
mov edi, s
repne scasb
lea esi, [edi - s - 1]
mcall send, [socketnum], s, , 0
jmp wait_for_servercommand
; esi = source ptr