FTP
*FTP项目,文件传输协议,通过网络传送文件 *
** 首先用网络编程的知识创建一个服务端和一个客户端,使他们能实现传输功能**。
-
ls,显示服务端的文件
popen();是一个指向以 NULL 结束的 shell命令字符串的指针。这行命令将被传到 bin/sh并使用 -c 标志,shell 将执行这个命令。 -
get,下载服务端的文件
文件名分割 -
put,上传本地文件到服务端
输入命令后进行字符分割,得到文件名字,然后读取文件内容,将名字和内容发送给服务端,服务端分割字符得到文件名,并创建新的文件,将获取的内容写入新文件中。
get命令类似put。(将服务端的文件传到客户端) -
quit,退出
-
cd,切换目录
-
高级功能
- 用户名密码验证