C/C ++/C#:如何执行"挂载

编程入门 行业动态 更新时间:2024-10-26 05:28:51
本文介绍了C/C ++/C#:如何执行"挂载-a& quot;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

问题:

在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#:如何执行"挂载

本文发布于:2023-05-25 10:57:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/226652.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:amp   quot   挂载

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!