From owner-freebsd-questions@FreeBSD.ORG Wed Aug 17 20:25:19 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4F9A716A41F for ; Wed, 17 Aug 2005 20:25:19 +0000 (GMT) (envelope-from murcielako@yahoo.com) Received: from web50106.mail.yahoo.com (web50106.mail.yahoo.com [206.190.38.34]) by mx1.FreeBSD.org (Postfix) with SMTP id BFF0243D46 for ; Wed, 17 Aug 2005 20:25:18 +0000 (GMT) (envelope-from murcielako@yahoo.com) Received: (qmail 64658 invoked by uid 60001); 17 Aug 2005 20:25:18 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=mdFcWJwt36ERtiK4fcHrBW6b4TXYvz15OSroUYXXHsFhinA1Y5t3gVdRdbyfTOmRFwC0fDC0SWbP4Rs8sSvnTycuhSzK+ExybUk3/jWk32WzKmFLvAr2UZPVfR7S9R3qzZqOXfS8NbnCl4bhWcHa3gcod0fSQjrYVcDgnj1xPnQ= ; Message-ID: <20050817202518.64656.qmail@web50106.mail.yahoo.com> Received: from [200.116.163.61] by web50106.mail.yahoo.com via HTTP; Wed, 17 Aug 2005 15:25:17 CDT Date: Wed, 17 Aug 2005 15:25:17 -0500 (CDT) From: "Jorge Mario G. Mazo" To: jdyke@azimainc.com In-Reply-To: <43039A20.7030803@azimainc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: freebsd-questions@freebsd.org Subject: Re: how to know the file system type [programming] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Aug 2005 20:25:19 -0000 --- jdyke 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/