2011-03-30 102 views

回答

3

我假設你正在談論在命令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

+0

感謝拷貝文件,我需要在運行時 – 2011-03-30 16:39:30

1

一般而言,可以在執行什麼可以從shell以外的程序調用該shell。

status = copy("Myfile1", "/YourDirectory/Myfile1"); 
if (status == OK) ..... 

你可能看手冊頁xcopy以及取決於你所需要的功能。

+1

應用解決方案沒有CP()例程,複製文件。有關文件操作例程的更多信息,請參見VxWorks內核API參考庫usrFsLib – 2011-04-04 15:15:37

0

您也可以在cmd shell(vxWorks 6.x)上使用「cp」命令,但這不是API,因此可能不會完全回答您的問題。