如何在Qt中移动文件? [英] How to move files in Qt?
本文介绍了如何在Qt中移动文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Qt中有一个跨平台的函数,相当于Windows中的MoveFile函数和Linux中的mv命令。
解决方案
当然, QDir :: rename()
遵循旧的Unix / POSIX传统调用这个重命名。
这是有意义的,如果你认为一个文件的完整路径:底层的inodes 只是获得分配一个不同的路径/文件标签。 / p>
Is there a cross-platform function in Qt that is equivalent to the MoveFile function in Windows and the mv command in Linux?
解决方案
Sure, QDir::rename()
following the old Unix / POSIX tradition of calling this rename.
Which makes sense if you think of a file with its complete path: the underlying inodes just get assigned a different path/file label.
这篇关于如何在Qt中移动文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文