openq
怎么样通过编程来获得一分区上的文件系统类型?
用mount来挂载一个分区时,需要通过 -t 选项来制定文件系统的类型。在shell下可以尝试用不同的文件系统来挂载文件系统,请问高手用c语言编程怎样发现分区文件系统的类型? 先谢谢啦!!!!
kenduest
[quote]原帖由 [i]openq[/i] 于 2008-6-1 22:30 发表 [url=http://linux.chinaunix.net/bbs/redirect.php?goto=findpost&pid=6602923&ptid=1008452][img]http://linux.chinaunix.net/bbs/images/common/back.gif[/img][/url]
用mount来挂载一个分区时,需要通过 -t 选项来制定文件系统的类型。在shell下可以尝试用不同的文件系统来挂载文件系统,请问高手用c语言编程怎样发现分区文件系统的类型? 先谢谢啦!!!! [/quote]
[url]http://kenduest.sayya.org/linux/fstype/[/url]
[code]
Linux:root~/tmp/fstype> ./fstype /dev/sda1
/dev/sda1 contains ext3 filesystem
Linux:root~/tmp/fstype>
Linux:root~/tmp/fstype>
Linux:root~/tmp/fstype> ./fstype /dev/sda5
/dev/sda5 contains swap filesystem
Linux:root~/tmp/fstype>
Linux:root~/tmp/fstype> ./fstype /dev/sda6
/dev/sda6 contains reiserfs filesystem
[/code]
--