-> 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
4 回答
我假设您正在讨论在命令shell中工作,因此命令可能如下所示:
I hope this helps HadziJo
您也可以在cmd shell(vxWorks 6.x)上使用“cp”命令,但这不是API,因此可能无法准确回答您的问题 .
我找到的最好的方法是
xcopy("fromPath", "toPath")
. 它将以递归方式(包括文件夹和子文件夹)复制(复制)从Path到Path的所有内容 .查看VxWork手册:http://www.vxdev.com/docs/vx55man/vxworks/ref/usrFsLib.html#xcopy
通常,可以从shell以外的程序调用可在shell执行的任何内容 .
根据您需要的功能,您可能会查看 man page 以获取
xcopy
.