linux 下 带shell功能ftp源代码

时间:2012-06-18 17:36:19
【文件属性】:

文件名称:linux 下 带shell功能ftp源代码

文件大小:23KB

文件格式:BZ2

更新时间:2012-06-18 17:36:19

ftp 源码 linux socket

################################################################################ # # # Super Ftp Server and Client for Wall-e # # # # SatMay30 2009 # # # ################################################################################ ////////\\\\\\\ ||Introduct || \\\\\\\\/////// Wall-e is a team for a project about two-demision code , for details at this:http://hi.baidu.com/hzau_wall_e this server and client programs is created for the s3c2410 platform board to conveniencely control it and fulfil files transferring at the same time , that is a simple combination for telnet and ftp server. Of course there are many fails and bugs in it , I'll appreciate the correction and criticism! ////////\\\\\\\ ||Functions || \\\\\\\\/////// 1 no count and no authentication , the shell running level result in who run the server in server side 2 basic ftp transferring functions as get files (g files ) and send files(s fname). 3 running common shells in client side(!cmd) and server side(cmd) ////////\\\\\\\ || Usage || \\\\\\\\/////// 1 run the server and client server: ./server_x # x is for your platform h for host pc, a for arm, as details to see Makefile client: ./client_x xx.xx.xx.xx then you can operate in the client side. the prompt of client side will be: Walle> 2 run server side shells [usage] : cmd [return]: return what the shell will return to stdout and stderr . [eg]: Walle>ls -l 总计 152 -rwxr-xr-x 1 root root 17382 05-30 22:00 client_a -rwxr-xr-x 1 root root 13060 05-30 22:00 client_h -rw-r--r-- 1 root root 4485 05-30 16:01 common.h -rwxr-xr-x 1 root root 462 05-30 21:43 Makefile -rw-r--r-- 1 root root 579 05-30 22:00 README -rw-r--r-- 1 root root 577 05-30 22:00 README~ -rwxr-xr-x 1 root root 20835 05-30 22:00 server_a -rwxr-xr-x 1 root root 16176 05-30 22:00 server_h -rwxr-xr-x 1 root root 5225 05-30 21:47 sock_client.c -rwxr-xr-x 1 root root 4362 05-30 15:09 sock_server.c Walle>cd /root Walle>pwd /root Walle> Walle>get aaa sh: get: command not found Walle> 3 run client side local shells [usage] :! cmd [return]: return what the shell will return to stdout and stderr . [eg] : Walle>!ls /root a es OperaDownloads aa f Pictures anaconda-ks.cfg fcitx Public automake_cn.htm g save_usb b install server_a client_h install.log server_h common.c install.log.syslog src common.h~ ked tcpd-0.2.0.tar.gz dairy Music Templates Desktop my_fs tmp Documents myos Unsaved Document 1 4 send files [usage] :s localfilename [return]: return successfully message,if success, or print error messages error message will be introduced below [eg] : Walle>! cd /usr/src/ Walle>s qt-embedded-linux-opensource-src-4.4.3.tar.gz send files successfully! Walle>ls -l ...... 1 root root 124238957 05-30 22:09 qt-embedded-linux-opensource-src-4.4.3.tar.gz Walle> tar xzvf qt-embedded-linux-opensource-src-4.4.3.tar.gz ...... 5 get files [usage] : g remotefilename [return]: return successfully message,if success, or print error messages error message will be introduced below [eg] : Walle> ls .... Walle>g tcpd-0.2.0.tar.gz get remote files successfully! Walle> 5 error return xsh:cmd: xxx xxx : error return from shells F_N_EST : file does not exists! SOCK_SEND_ERR : send socket data err! case S_RPC_TIMEOUT : socket rpc timeout!(wait for 5 secs no sequential data arrives from server) case F_C_ERR : file create error! default : unknown error! 6 bugs both side couldn't send control signal to each other, that is you can only send message that after a line break. so there are many shells programs couldn't be runned by client side: vi, ex,ed ,top ... , I'm really sorry for this. 7 contact if you've any questions please send Email to me at supertiger@yahoo.cn or chat me by QQ : 547268476, I'll appreciate it !


网友评论

  • 自己实现ftp的代码,用起来缺少很多功能,比如passive模式等等。建议使用wput,很方便很强大的ftp。
  • 还行,用起来有点麻烦
  • 还以为是shell脚本实现的 c现实的有点麻烦
  • 不错的ftp小程序,C实现的,要是能先用简单的中文说说到底能做哪些事就更好了