잉여 FTP 클라이언트 코드

client.c
안 할 수도 없고 대충 하긴 하는데 완전 잉여 코드네..
자바로 좀 잘 만들어서 크라켄 패키지 시스템에서 FTP를 지원하게 해볼까..
[xeraph@navi hw6]$ ./a.out localhost qoo **** pub
[*] 220 (vsFTPd 2.1.2)
[-] Sending username: qoo
[*] 331 Please specify the password.
[-] Sending password
[*] 230 Login successful.
[-] Set image mode
[*] 200 Switching to Binary mode.
[-] Changing directory to pub
[*] 250 Directory successfully changed.
[*] 227 Entering Passive Mode (127,0,0,1,69,96).
[-] Retrieving file list
[-] Connecting 127.0.0.1:17760 for ftp-data
[*] 150 Here comes the directory listing.
kraken-core-1.4.2-package.jar
test.txt
test2.txt
test3.txt
ttt
[*] 226 Directory send OK.
[-] Listing completed.
[*] 227 Entering Passive Mode (127,0,0,1,75,193).
[-] Fetch file: ttt
[-] Connecting 127.0.0.1:19393 for ftp-data
[*] 550 Failed to open file.
[*] 227 Entering Passive Mode (127,0,0,1,217,96).
[-] Fetch file: test3.txt
[-] Connecting 127.0.0.1:55648 for ftp-data
[*] 150 Opening BINARY mode data connection for test3.txt (9 bytes).
[-] OK: 9 bytes copied
[*] 226 File send OK.
[*] 227 Entering Passive Mode (127,0,0,1,35,145).
[-] Fetch file: test2.txt
[-] Connecting 127.0.0.1:9105 for ftp-data
[*] 550 Failed to open file.
[*] 227 Entering Passive Mode (127,0,0,1,33,223).
[-] Fetch file: test.txt
[-] Connecting 127.0.0.1:8671 for ftp-data
[*] 150 Opening BINARY mode data connection for test.txt (8 bytes).
[-] OK: 8 bytes copied
[*] 226 File send OK.
[*] 227 Entering Passive Mode (127,0,0,1,226,131).
[-] Fetch file: kraken-core-1.4.2-package.jar
[-] Connecting 127.0.0.1:57987 for ftp-data
[*] 150 Opening BINARY mode data connection for kraken-core-1.4.2-package.jar (6504345 bytes).
[-] OK: 6504345 bytes copied
[*] 226 File send OK.
[*] 227 Entering Passive Mode (127,0,0,1,50,13).
[-] Completed.
[xeraph@navi hw6]$ ls
a.out client.c kraken-core-1.4.2-package.jar test3.txt test.txt


트랙백

이 글과 관련된 글 쓰기 (트랙백 보내기)
TrackbackURL : http://www.xeraph.com/tb/5260763 [도움말]

덧글

  • 토깽 2010/05/04 07:16 # 답글

    학교 다닐 때 좀 열심히 배울걸.
    이게 다 너 때문이야(...)
댓글 입력 영역