tftp传文件

来源:互联网 发布:淘宝店铺招牌是哪个 编辑:程序博客网 时间:2024/06/12 20:22
用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;
}
0 0
原创粉丝点击