linux - 检查与 tftp 服务器的连接以及文件的可访问性

标签 linux embedded-linux tftp

我有 BusyBox v1.23.2 多调用二进制文件。 带有简单的 tftp 客户端。 我需要检查与 tftp 服务器的连接以及那里文件的可访问性。 对于 ftp,它可能如下所示:

if wget -q -s $url; then
            echo "found"
fi

tftp有可靠的解决方案吗?

附:我无法尝试下载该文件(文件太大)。

更新:我通过在 BusyBox 的源代码中添加 hack 解决了这个问题,它允许实现一个场景,如下所示:

"No.","Source","Destination","Info" 
"1","192.168.0.8","192.168.0.6","Read Request, File: some_folder/file.txt, Transfer type: octet, blksize\\000=4096\\000, tsize\\000=0\\000" 
"2","192.168.0.6","192.168.0.8","Option Acknowledgement, blksize\\000=4096\\000, tsize\\000=10094\\000" 
"3","192.168.0.8","192.168.0.6","Error Code, Code: Not defined, Message: Connection checking"

最佳答案

我想这对你有用。

$ wget --spider http://henning.makholm.net/
Spider mode enabled. Check if remote file exists.
--2011-08-08 19:39:48--  http://henning.makholm.net/
Resolving henning.makholm.net (henning.makholm.net)... 85.81.19.235
Connecting to henning.makholm.net (henning.makholm.net)|85.81.19.235|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9535 (9.3K) [text/html]     <-------------------------
Remote file exists and could contain further links,
but recursion is disabled -- not retrieving.

关于linux - 检查与 tftp 服务器的连接以及文件的可访问性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38013108/

相关文章:

linux - 使用 Rtlinux 命令运行可执行文件与使用 FIFO 策略调度进程/线程之间的区别

c - 函数 getgrgid() 在无人调用时返回 NULL

linux - tftp: 服务器错误: (2) 访问冲突

c++ - winsock select() 函数返回 0

c - TFTP UDP header 校验和失败

linux - 集中式和分布式版本控制团队的优缺点

c - 管道在 Linux 中是如何工作的?

linux - rsync从mac到linux : colon replacement

linux - 服务器向所有用户控制台打印消息

embedded-linux - Yocto 添加自定义 UBoot 环境变量