Qt:从NFS共享访问文件时出错 我正在使用Qt 4.8的C++应用程序。我正在/mnt/上装载NFS共享。NFS服务器位于Windows server 2016上

Qt:从NFS共享访问文件时出错 我正在使用Qt 4.8的C++应用程序。我正在/mnt/上装载NFS共享。NFS服务器位于Windows server 2016上,c++,linux,qt,nfs,C++,Linux,Qt,Nfs,mount命令:mount-t nfs 192.168.1.5:/nfs\u SHARE/mnt/nfs\u repo/ 在客户端(linux)安装共享时,我可以在共享中导航,读取其中的所有文件,等等 在Qt应用程序中,我可以浏览共享,但我看不到文件夹中的文件 例如,我可以访问共享中的文件夹: QDir nfsDir("/mnt/nfs_repo/test/test2/); if(nfsDir.exists()) qDebug() << "The repo " <

mount命令:
mount-t nfs 192.168.1.5:/nfs\u SHARE/mnt/nfs\u repo/

在客户端(linux)安装共享时,我可以在共享中导航,读取其中的所有文件,等等

在Qt应用程序中,我可以浏览共享,但我看不到文件夹中的文件

例如,我可以访问共享中的文件夹:

QDir nfsDir("/mnt/nfs_repo/test/test2/);
if(nfsDir.exists())
        qDebug() << "The repo " << nfsDir.path() << " is accessible"; //this outputs The repo /mnt/nfs_repo/test/test2 is accessible.

QStringList fileList = nfsDir.entryInfoList(QDir::AllEntries); //fileList is empty after this 
QDir-nfsDir(“/mnt/nfs_-repo/test/test2/);
if(nfsDir.exists())

qDebug()为您的挂载点设置适当的权限。请尝试此测试
chmod 777/mnt/nfs\u repo/
我尝试了此测试,但仍然没有任何权限,我可以访问该文件夹,但在列出文件夹中的文件时仍然没有权限如果指定任何系统目录(其中包含一些文件),您可以看到非空列表吗?是,如果它是系统上的任何其他目录(我在本地用相同的文件复制了确切的文件夹层次结构),它像一个符咒一样工作。我有一个QStringList,其中列出了文件夹中的每个文件。因此,它显然来自nfs共享。UID和GUID有奇怪的值这一事实会导致这样的问题吗?很可能是。尝试使用以下格式装载
mount-tfs-o umask=0022,gid=XXX,UID=yyyy 192.168.1.5:/nfs\u share/mnt/nfs\repo/