- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在创建一个 FTP 服务器作为一个学校项目,大多数命令都在工作,我几乎确定了 PORT
(数据传输的主动模式)。
像这样使用 ftp 启动我的服务器:
ftp localhost 4242 // where 4242 is the port on which my server is listening
登录后使用命令 ls
,我收到一个有效的 ls
输出,后跟此消息:
WARNING! 8 bare linefeeds received in ASCII mode File may not have transferred correctly.
请注意,在 ftp
中使用 ls
时,它会在使用 LIST
命令之前自动切换到事件模式。
此错误表示什么?
完整输出:
200 Active Mode Enabled.
150 Directory listing.
total 56
drwxrwxr-x 4 kade_c kade_c 4096 mai 12 15:24 .
drwxr-xr-x 38 kade_c kade_c 4096 mai 12 14:58 ..
drwxrwxr-x 8 kade_c kade_c 4096 mai 12 15:17 .git
-rw-rw-r-- 1 kade_c kade_c 1726 mai 11 10:35 Makefile
-rw-rw-r-- 1 kade_c kade_c 161 mai 11 11:43 README.txt
-rwxrwxr-x 1 kade_c kade_c 29368 mai 12 15:24 server
drwxrwxr-x 4 kade_c kade_c 4096 mai 2 18:40 server_src
WARNING! 8 bare linefeeds received in ASCII mode
File may not have transferred correctly.
226 LIST complete.
最后,这是创建、连接到套接字并执行 ls -la
的代码部分:
server_write(client, "150 Directory listing.\r\n");
if (connect_data(client) == -1) // Creates socket and connects to it
{
server_write(client, "520 Impossible to reach client.\r\n");
return;
}
ofd = xdup(1);
xdup2(client->data.socket, 1);
system("ls -la");
xdup2(ofd, 1);
server_write(client, "226 LIST complete.\r\n");
close_data(client, -1);
最佳答案
此问题是因为您正在以 ASCII 模式下载文件。切换到二进制模式将使警告消失。
登录到 FTP 服务器后,键入 binary
,然后开始下载。
ftp> binary
200 Type set to I.
您只需在每个 FTP session 中运行一次此命令。
关于c - 在我的 FTP 服务器上列出目录时出现 "bare linefeeds received in ASCII mode"警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37187986/
在Delphi Prism中,C#的\ n和Visual Basic的vbCRLF或vbNewLine等效吗?我必须使用Environment.NewLine吗? 最佳答案 实际上,Environme
我想删除按回车键输入的换行符。但是当我执行以下操作时,它会从文本中删除最后一个字符。为什么? - (BOOL)textView:(UITextView *)textView shouldChangeT
在我的 Android 应用程序上,我尝试将图像编码为 Base64 字符串,以将其发送到处理它的 API。当从 AngularJS(网络)编码文件并发送它时,它可以正常工作,但仍然没有找到使其与 A
我正在使用 ant 1.8.2。假设测试因 stackoverflow 错误而失败。 import junit.framework.TestCase; /**a failing test */ p
我正在使用 mySQL CONCAT_WS() 函数来获取一组逗号分隔值。 我需要输出显示为一组行而不是 CSV。如何做到这一点? 谢谢,泽。 最佳答案 SELECT CONCAT_WS("\n",
我不明白为什么会收到 NoSuchElementException。我正在阅读的文件是以 LF 结尾的,并且该代码已经在生产环境中运行了一年。在调试过程中,我的同事发现,当文件以 LF 结尾并且长度恰
我正在尝试在 shell 文件 (.sh) 中捕获“\”和换行符。我在网站上试过:https://regexr.com/它有效。但是好像和shell文件里的方式不太一样。 这是目标,我想得到这三个匹配
我正在创建一个 FTP 服务器作为一个学校项目,大多数命令都在工作,我几乎确定了 PORT(数据传输的主动模式)。 像这样使用 ftp 启动我的服务器: ftp localhost 4242 // w
使用 Jackson,我正在尝试用 JSON 编码数据,但它给出了异常。 我尝试了 String 数据和 byte[] 数据: String representation of same data i
我是一名优秀的程序员,十分优秀!