VxWorks 上的 CopyFile()

发布于 2024-10-28 06:46:35 字数 62 浏览 1 评论 0原文

VxWorks 上复制文件的简单 API(类似于 Windows API 上的 CopyFile())是什么?

What is simple API for copy file(s) on VxWorks (look like a CopyFile() on Windows API)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

千柳 2024-11-04 06:46:35

我假设您正在谈论在命令 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

我希望这会有所帮助
哈吉乔

I assume you are talking about working in the command shell, so the commands may look like:

-> 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

I hope this helps
HadziJo

苦妄 2024-11-04 06:46:35

一般来说,任何可以在 shell 中执行的东西都可以从 shell 之外的程序中调用。

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

您还可以查看 xcopy手册页,具体取决于您需要的功能。

Generally, anything that can be executed at the shell can be called from a program other than the shell.

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

You might look at the man page for xcopy as well depending on the functionality you need.

顾北清歌寒 2024-11-04 06:46:35

您还可以在 cmd shell (vxWorks 6.x) 上使用“cp”命令,但这不是 API,因此可能无法准确回答您的问题。

You can also use "cp" command on cmd shell (vxWorks 6.x), but that is not API, so probably doesn't answer your question exactly.

2024-11-04 06:46:35

我发现的最好的方法是 xcopy("fromPath", "toPath")。它将递归地(包括文件夹和子文件夹)复制(复制)从Path到Path的所有内容。

查看 VxWork 手册:http://www.vxdev。 com/docs/vx55man/vxworks/ref/usrFsLib.html#xcopy

The best method I found is xcopy("fromPath", "toPath"). It will recursively (including folders and subfolders) copy (duplicate) everything fromPath toPath.

check out the VxWork Manual: http://www.vxdev.com/docs/vx55man/vxworks/ref/usrFsLib.html#xcopy

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文