问题:
在C/C ++/C#中.(对于C#,我需要它,但是C和C ++也可以).
In C/C++/C#. (I need it for C#, but C and C++ is also fine).
如何在Linux上进行挂载-a.我的意思是,以编程方式不开始
How can I do a mount -a on Linux. I mean programmatically, without starting a process like
system("mount -a");注意"-a".我的问题实际上不是关于如何挂载A挂载点.关于如何在/etc/fstab中挂载所有挂载点.这意味着解析文件,提取挂载点,检查是否已挂载,只有在尚未挂载的情况下才挂载...
Note the "-a". My question is not actually about how to mount A mountpoint. It's about how to mount ALL mountpoints in /etc/fstab. That means parsing the file, extracting the mountpoints, check if already mounted, and only if not already mounted, mount...
推荐答案getmntent 可以帮助您阅读/etc/fstab (然后在其他答案中使用mount函数).
getmntent can help you read /etc/fstab (and then use the mount function in the other answers).
更多推荐
C/C ++/C#:如何执行"挂载
发布评论