使用C同步文件夹
我想使用 C 同步两个文件夹的内容。我没有任何代码行,我只是希望有人建议一个好的教程来开始。
I want to synchronize the contents of two folders using C. I don't have any line of code, I simple want someone to suggest a good tutorial to start with.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
首先,没有“C”方法可以做到这一点。您将需要使用依赖于平台的文件系统函数。您运行什么操作系统?
在 Linux 系统上,尝试
opendir
和朋友(来自 dirent .h)。在 Windows 系统上,请尝试此列表 Win32 文件管理功能。
First of all, there is no 'C' way to do this. You will need to use platform-dependent filesystem functions. What OS are you running?
On Linux systems, try
opendir
and friends (from dirent.h).On Windows systems, try this listing of Win32 File Management functions.
您需要了解
dirent.h
和stat
。谷歌搜索我发现此链接。You need to learn about
dirent.h
andstat
. Googling for those I found this link.我建议不要编写代码,而是使用Sync Butler。
否则,您可能需要在 Boost 库中搜索任何独立于平台的访问文件夹的方法(因为您没有告诉我们您正在使用哪个操作系统或平台)。
I suggest not writing code, but using Sync Butler.
Otherwise you may want to search the Boost library for any platform independent methods for accessing folders (since you didn't tell us which OS or platform you are using).