阅读:1611回复:0
[求助]急急急急Vxworks目标机与Linux主机间通过FTP实现文件传输的问题
Vxworks作为客户端,Linux作为服务器!
现在用过两种方法试着文件读写: 1.在tornado2.2中进入SHELL,执行Iam用户名和密码, iam("jhb","jhb") value=0=0X0 利用Whoami查看后有用户显示 whoami jhb value=4=0x4 然后运行netDevCreate("FTP:","Host",1),执行Devs可以看到有Ftp虚拟设备 netDevCreate("ftp:","host",1) value=0=0x0 devs drv name 0/null 1/tyCo/0 2/pcConsole/0 2/pcConsole/1 4/fd0 4/ata0a 6/host: 7/vio 6/ftpdev: 6/ftp: value=0=0x0 再运行FD=Open("FTP:\Temp",2),结果返回Value=-1.文件不能被新建. 2. 我写了一个程序,源码如下: #include <sys/types.h> #include <ioLib.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int fd1,fd2; usrAtaConfif(0,0,"c:"); char buffer[10] ={'a','b','c','d','e','f','g','h','i','j'} ; fd1 = open ("c:/temp.txt", O_CREAT|O_RDWR, 0644); if(fd1 == ERROR){ printf("create file error and error is:%dn",fd1); }else{ writefile(buffer,fd1); close(fd1); } fd2 = open ("c:/temp.txt", 0, 0644); if(fd2 == ERROR){ printf("open file error and error is:%dn",fd2); }else{ readfile(buffer,fd2); close(fd2); } return 0; } writefile(char *buf,int fd) { int h; h = write(fd,buf,10); if(h == ERROR) printf("write errorn"); else printf("write filen"); printf("write h is %dn",h); return; } readfile(char *buf,int fd) { int h; h = read(fd,buf,10); if(h == ERROR) printf("read errorn"); else{ printf("read h is %dn",h); printf("string is %sn",buf); } return; } 下载到目标机运行后提示: write filenwrite h is 10nopen file error and error is:-1n 望各位大虾指点迷津,都做了十来天了!!!随便告知一种方法即可!不胜感谢!!! |
|