tftp传文件
2016-01-07 14:12
483 查看
用tftp, udpsvd -vE 0 69 tftpd -c /server & 开启tftpd服务器,
然后在318上执行 tftp -pl file ipaddress
tftp -gl main 1.1.1.100即可。
udhcpd -f /app/cfg/udhcpd.conf
#include <fcntl.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
int main(int argc, char **argv)
{
if(argc!=2){
printf("error par number\n");
return 0;
}
int fd = open (argv[1], O_RDWR);
if(fd==-1){
printf("open %s error\n",argv[1]);
return 0;
}
fsync (fd);
close (fd);
printf("ok\n");
return 0;
}
然后在318上执行 tftp -pl file ipaddress
tftp -gl main 1.1.1.100即可。
udhcpd -f /app/cfg/udhcpd.conf
#include <fcntl.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
int main(int argc, char **argv)
{
if(argc!=2){
printf("error par number\n");
return 0;
}
int fd = open (argv[1], O_RDWR);
if(fd==-1){
printf("open %s error\n",argv[1]);
return 0;
}
fsync (fd);
close (fd);
printf("ok\n");
return 0;
}
相关文章推荐
- Yii系列总结:yii 标签用法
- php 接口实例
- PHP 日期函数说明
- XHProf的安装和使用(PHP性能测试神器)
- vs 打印信息到Output
- Phpwind v8.7怎么修改默认编辑器字体方法?
- php 多重继承的替代方案trait
- PHP中substr函数字符串截取用法分析
- PHP中addcslashes与stripcslashes函数用法分析
- Yii 1.0数据库操作 查询、增加、更新、删除(事务处理)
- Jmeter中ftp测试下载默认路径及文件
- PHP 中 Orientation 属性判断上传图片是否需要旋转(转)
- PHP 自 5.2 到 5.6 中新增的功能详解
- PHP 正则表达式获取图片URL
- php 对象和数组的赋值过程
- Yii CDBCriteria常用方法 (多条件查询)
- 使用php+swoole对client数据实时更新(一)
- PHP中addslashes()和stripslashes()实现字符串转义和还原用法实例
- 使用php+swoole对client数据实时更新(上)
- php的一些学习经验