如何确定我的代码正在读取或写入的文件是否在运行时从 C/C++ 代码中安装在 Lustre、GPFS 或 NFS 之上的路径上?
编辑:工作代码:
#include <sys/vfs.h>
#include <iostream>
int main(int argc, char** argv) {
struct statfs sf;
statfs(argv[0], &sf);
std::cout << "f_type =" << std::hex << sf.f_type << "\n";
}
对半 C,半 C++ 感到抱歉。