Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Jul 2009 15:36:05 +0200
From:      Erik Trulsson <ertr1013@student.uu.se>
To:        Unga <unga888@yahoo.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: How to find what symlink points to?
Message-ID:  <20090727133605.GA7137@owl.midgard.homeip.net>
In-Reply-To: <310025.75856.qm@web57001.mail.re3.yahoo.com>
References:  <310025.75856.qm@web57001.mail.re3.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@student.uu.se



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