VxWorks上的CopyFile()

什么是VxWorks上的复制文件的简单API(在Windows API上看起来像CopyFile())?     
已邀请:
我假设您正在讨论在命令shell中工作,因此命令可能如下所示:
-> ls // lists the current directory contents
Myfile1
Myfile2
YourFile2.txt
value = 0 = 0x0          //return status of the ls command - executed w/o errors*

-> copy "Myfile1","/YourDirectory/Myfile1"    // FORMAT: copy "src" , "dest"*
                                              // NB: src & dest argument must be strings*
value = 0 = 0x0                               // return status of copy command.

-> cd "/YourDirectory/"  // change default directory - notice the trailing slash (/)
value = 0 = 0x0          // return status of cd command

-> ls
xyzfile
Myfile1
value = 0 = 0x0
我希望这有帮助 HadziJo     
通常,可以从shell以外的程序调用可以在shell上执行的任何内容。
status = copy("Myfile1", "/YourDirectory/Myfile1");
if (status == OK)  .....
您可能会查看
xcopy
的手册页,具体取决于您需要的功能。     
您也可以在cmd shell(vxWorks 6.x)上使用“cp”命令,但这不是API,因此可能无法准确回答您的问题。     
我找到的最好的方法是
xcopy("fromPath", "toPath")
。它将以递归方式(包括文件夹和子文件夹)复制(复制)从Path到Path的所有内容。 查看VxWork手册:http://www.vxdev.com/docs/vx55man/vxworks/ref/usrFsLib.html#xcopy     

要回复问题请先登录注册