2

Is there something similar to statfs in Java to determine the filesystem type of a given file? More specifically I'd like to determine if a file provided by a user is on a shared or local filesystem. I'm going to use this information to determine if the application is opening several identically named files on the local filesystem of a distributed application, or one shared file.

I suppose if I can get something like "NFS", "Lustre", "EXT3", etc either as a string or an enumeration then I can program a mapping to shared/not shared. Let's assume the file exists and is readable.

4

1 回答 1

1

据我所知,没有 - Java 不提供对您正在寻找的信息的访问。

我认为您唯一真正的选择是编写一个共享库,并使用 JNI 或 JNA 来访问它。

于 2013-05-21T02:39:55.040 回答