Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Aug 2005 13:28:41 -0700 (PDT)
From:      dpk <dpk@dpk.net>
To:        "Jorge Mario G. Mazo" <murcielako@yahoo.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: how to know the file system type [programming]
Message-ID:  <20050817132719.N13385@shared10.hosting.flyingcroc.net>
In-Reply-To: <20050817195522.28381.qmail@web50101.mail.yahoo.com>
References:  <20050817195522.28381.qmail@web50101.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 17 Aug 2005, Jorge Mario G. Mazo wrote:

> hi there
> I've been looking for a way to check the fs type
> I need to do something like this
>
> if NTFS do this
> if msdis do that
> if ufs2  do that
> if ext2 do this other stuff
>
> thanks in advance

I'd check out the fdisk code. For example:

$ fdisk /dev/ad0 | grep sysid
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)

Figure out how it determines the sysid, and then you can use that in your
code. You'd still need a function to determine what disks are physically
present.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050817132719.N13385>