日期:2014-05-16  浏览次数:20648 次

linux如何读写网络共享文件
1、linux不通过nfs把共享目录挂载到本机上的情况下,用c或c++编程怎么读写网络上共享的文件?
2、如果挂载的话,怎么样通过c或c++编程来判定是否挂载成功?

------解决方案--------------------
应该是系统调用。而不是c库函数,或者c++的标准。
------解决方案--------------------
首先要有权限.
------解决方案--------------------
man 2 mount和 man 8 mount


filesystemtype:
Values for the filesystemtype argument supported by the kernel are listed in /proc/filesystems (like "minix",
"ext2", "msdos", "proc", "nfs", "iso9660" etc.). Further types may become available when the appropriate modules
are loaded.
内核必须要先支持的

mountflags:
man 2 mount去看

data:
The data argument is interpreted by the different file systems. Typically it is a string of comma-separated
options understood by this file system. See mount(8) for details of the options available for each filesystem
type.

------解决方案--------------------
不懂,up
------解决方案--------------------
不懂,up
------解决方案--------------------
内核跟不上了吧,路过
------解决方案--------------------
mark.
------解决方案--------------------
是不是用户权限的问题啊?
------解决方案--------------------
http://topic.csdn.net/u/20090109/14/781b3646-5352-4221-88bf-95b18e03f07e.html

看看这个帖子,我已经结贴了,最后一个答案可以回答你的问题