我问上面的问题是因为每当我用它来确定最后保存文件的人时,它只会返回一个空字符串。我做错了吗,或者是否有等效的库/方法可以为我做这件事?
忘记添加我的代码。很简单。
QFileInfo fileName = it.fileInfo();
qDebug() << fileName.owner();
最佳答案
下面是 Qt 关于 ownerId() 的说法:
uint QFileInfo::ownerId() const
Returns the id of the owner of the file.
On Windows and on systems where files do not have owners this function returns ((uint) -2).
关于c++ - 是否有 QFileinfo::Owner() 的 Windows 等价物?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19226952/