开发者

Ruby: cross-platform way to determine whether NFS is installed?

开发者 https://www.devze.com 2023-01-25 10:42 出处:网络
I need to detect whether NFS is installed or not on the running server in my Ruby code. If there is any way I can do this in cross开发者_开发百科-platform way(or at least in unix/linux)?I can\'t thin

I need to detect whether NFS is installed or not on the running server in my Ruby code.

If there is any way I can do this in cross开发者_开发百科-platform way(or at least in unix/linux)?


I can't think of a cross platform way to do it as there's no standards for getting kernel info. I think it would have to be specific to the guest OS type. Linux you could do "modinfo nfs". Solaris boxes you could also use modinfo and search for nfs in the output or look in /etc/dfs/fstypes. Using "uname -s" will tell you which method to use.

0

精彩评论

暂无评论...
验证码 换一张
取 消