Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Aug 2005 15:25:17 -0500 (CDT)
From:      "Jorge Mario G. Mazo" <murcielako@yahoo.com>
To:        jdyke@azimainc.com
Cc:        freebsd-questions@freebsd.org
Subject:   Re: how to know the file system type [programming]
Message-ID:  <20050817202518.64656.qmail@web50106.mail.yahoo.com>
In-Reply-To: <43039A20.7030803@azimainc.com>

next in thread | previous in thread | raw e-mail | index | archive | help

 --- jdyke <jdyke@azimainc.com> escribió:

> 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
> 
> not sure if this is what your looking for, but there
> are likely a million ways, 
> one being
> 
> in bash
> 
> $ fs_to_check=/dev/ad4s1g
> $ fstype=`grep $fs_to_check /etc/fstab | awk '{
> print $3 }'`
> $ echo $fstype
> ufs
> 
> $
> 
> could be similarly scripted
> 
> > 
> > thanks in advance
hi there
it has to be pure C and parsing the fstab in C is not
an option!
also what about if the partition is not in fstab?

reading cp.c and utils.c is see this "struct stat *fs"
but I cant find any documentation for it. any ideas
about this approach?

thanks

=================================================================
Either write things worth reading, Or do things worth the writing. 
                                                -Benjamin Franklin

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.espanol.yahoo.com/ 



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