From owner-freebsd-questions@FreeBSD.ORG Mon Jul 27 13:36:43 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 564391065739 for ; Mon, 27 Jul 2009 13:36:43 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from ch-smtp01.sth.basefarm.net (ch-smtp01.sth.basefarm.net [80.76.149.212]) by mx1.freebsd.org (Postfix) with ESMTP id 0A8CE8FC12 for ; Mon, 27 Jul 2009 13:36:42 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from c83-255-48-78.bredband.comhem.se ([83.255.48.78]:56635 helo=falcon.midgard.homeip.net) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1MVQN5-0001bj-5q for freebsd-questions@freebsd.org; Mon, 27 Jul 2009 15:36:09 +0200 Received: (qmail 22045 invoked from network); 27 Jul 2009 15:36:05 +0200 Received: from owl.midgard.homeip.net (10.1.5.7) by falcon.midgard.homeip.net with ESMTP; 27 Jul 2009 15:36:05 +0200 Received: (qmail 7167 invoked by uid 1001); 27 Jul 2009 15:36:05 +0200 Date: Mon, 27 Jul 2009 15:36:05 +0200 From: Erik Trulsson To: Unga Message-ID: <20090727133605.GA7137@owl.midgard.homeip.net> References: <310025.75856.qm@web57001.mail.re3.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <310025.75856.qm@web57001.mail.re3.yahoo.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-Originating-IP: 83.255.48.78 X-Scan-Result: No virus found in message 1MVQN5-0001bj-5q. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1MVQN5-0001bj-5q 264d0129e1e6f46ec2a53534c94788fe Cc: freebsd-questions@freebsd.org Subject: Re: How to find what symlink points to? 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: Mon, 27 Jul 2009 13:36:43 -0000 On Mon, Jul 27, 2009 at 05:44:59AM -0700, Unga wrote: > > Hi all > > I need to remove some unwanted symlinks on /dev using a C program. > > The "struct dirent" only shows the symlink name, how do I find what that > symlink points to for verification purpose? By using the readlink(2) system call. -- Erik Trulsson ertr1013@student.uu.se